Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(114)

Side by Side Diff: chrome/browser/resources/file_manager/js/image_editor/gallery.js

Issue 10387152: [filemanager] In Gallery, do not allow to rename files in readonly directory. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 /* 5 /*
6 * Base class that Ribbon uses to display photos. 6 * Base class that Ribbon uses to display photos.
7 */ 7 */
8 8
9 function RibbonClient() {} 9 function RibbonClient() {}
10 10
(...skipping 467 matching lines...) Expand 10 before | Expand all | Expand 10 after
478 } 478 }
479 479
480 this.context_.onNameChange(fullName); 480 this.context_.onNameChange(fullName);
481 481
482 var displayName = ImageUtil.getFileNameFromFullName(fullName); 482 var displayName = ImageUtil.getFileNameFromFullName(fullName);
483 this.filenameEdit_.value = displayName; 483 this.filenameEdit_.value = displayName;
484 this.filenameText_.textContent = displayName; 484 this.filenameText_.textContent = displayName;
485 }; 485 };
486 486
487 Gallery.prototype.onFilenameClick_ = function() { 487 Gallery.prototype.onFilenameClick_ = function() {
488 // We can't rename files in readonly directory.
489 if (this.context_.readonlyDirName)
490 return;
491
488 ImageUtil.setAttribute(this.filenameSpacer_, 'renaming', true); 492 ImageUtil.setAttribute(this.filenameSpacer_, 'renaming', true);
489 setTimeout(this.filenameEdit_.select.bind(this.filenameEdit_), 0); 493 setTimeout(this.filenameEdit_.select.bind(this.filenameEdit_), 0);
490 this.cancelFading_(); 494 this.cancelFading_();
491 }; 495 };
492 496
493 Gallery.prototype.onFilenameEditBlur_ = function() { 497 Gallery.prototype.onFilenameEditBlur_ = function() {
494 if (this.filenameEdit_.value && this.filenameEdit_.value[0] == '.') { 498 if (this.filenameEdit_.value && this.filenameEdit_.value[0] == '.') {
495 this.editor_.getPrompt().show('file_hidden_name', 5000); 499 this.editor_.getPrompt().show('file_hidden_name', 5000);
496 this.filenameEdit_.focus(); 500 this.filenameEdit_.focus();
497 return; 501 return;
(...skipping 991 matching lines...) Expand 10 before | Expand all | Expand 10 after
1489 ShareMode.prototype.setUp = function() { 1493 ShareMode.prototype.setUp = function() {
1490 ImageEditor.Mode.prototype.setUp.apply(this, arguments); 1494 ImageEditor.Mode.prototype.setUp.apply(this, arguments);
1491 ImageUtil.setAttribute(this.menu_, 'hidden', false); 1495 ImageUtil.setAttribute(this.menu_, 'hidden', false);
1492 ImageUtil.setAttribute(this.button_, 'pressed', false); 1496 ImageUtil.setAttribute(this.button_, 'pressed', false);
1493 }; 1497 };
1494 1498
1495 ShareMode.prototype.cleanUpUI = function() { 1499 ShareMode.prototype.cleanUpUI = function() {
1496 ImageEditor.Mode.prototype.cleanUpUI.apply(this, arguments); 1500 ImageEditor.Mode.prototype.cleanUpUI.apply(this, arguments);
1497 ImageUtil.setAttribute(this.menu_, 'hidden', true); 1501 ImageUtil.setAttribute(this.menu_, 'hidden', true);
1498 }; 1502 };
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698