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

Side by Side Diff: ui/file_manager/gallery/js/gallery.js

Issue 397543002: Gallery.app: Don't dispatch an event to update when renaming is not done. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 5 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 | ui/file_manager/gallery/js/gallery_item.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 'use strict'; 5 'use strict';
6 6
7 /** 7 /**
8 * Called from the main frame when unloading. 8 * Called from the main frame when unloading.
9 * @param {boolean=} opt_exiting True if the app is exiting. 9 * @param {boolean=} opt_exiting True if the app is exiting.
10 */ 10 */
(...skipping 756 matching lines...) Expand 10 before | Expand all | Expand 10 after
767 if (item) { 767 if (item) {
768 var oldEntry = item.getEntry(); 768 var oldEntry = item.getEntry();
769 769
770 item.rename(this.filenameEdit_.value).then(function() { 770 item.rename(this.filenameEdit_.value).then(function() {
771 var event = new Event('content'); 771 var event = new Event('content');
772 event.item = item; 772 event.item = item;
773 event.oldEntry = oldEntry; 773 event.oldEntry = oldEntry;
774 event.metadata = null; // Metadata unchanged. 774 event.metadata = null; // Metadata unchanged.
775 this.dataModel_.dispatchEvent(event); 775 this.dataModel_.dispatchEvent(event);
776 }.bind(this), function(error) { 776 }.bind(this), function(error) {
777 if (error === 'NOT_CHANGED')
778 return;
777 this.filenameEdit_.value = 779 this.filenameEdit_.value =
778 ImageUtil.getDisplayNameFromName(item.getEntry().name); 780 ImageUtil.getDisplayNameFromName(item.getEntry().name);
779 this.filenameEdit_.focus(); 781 this.filenameEdit_.focus();
780 if (typeof error === 'string') 782 if (typeof error === 'string')
781 this.prompt_.showStringAt('center', error, 5000); 783 this.prompt_.showStringAt('center', error, 5000);
782 else 784 else
783 return Promise.reject(error); 785 return Promise.reject(error);
784 }.bind(this)).catch(function(error) { 786 }.bind(this)).catch(function(error) {
785 console.error(error.stack || error); 787 console.error(error.stack || error);
786 }); 788 });
(...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after
964 window.loadTimeData.data = backgroundComponents.stringData; 966 window.loadTimeData.data = backgroundComponents.stringData;
965 gallery = new Gallery(backgroundComponents.volumeManager); 967 gallery = new Gallery(backgroundComponents.volumeManager);
966 }; 968 };
967 969
968 /** 970 /**
969 * Loads entries. 971 * Loads entries.
970 */ 972 */
971 window.loadEntries = function(entries, selectedEntries) { 973 window.loadEntries = function(entries, selectedEntries) {
972 gallery.load(entries, selectedEntries); 974 gallery.load(entries, selectedEntries);
973 }; 975 };
OLDNEW
« no previous file with comments | « no previous file | ui/file_manager/gallery/js/gallery_item.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698