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

Unified Diff: ui/file_manager/file_manager/foreground/js/file_manager.js

Issue 275493006: Files.app: Fix selection on creating new folder (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Addressed the comment Created 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ui/file_manager/file_manager/foreground/js/directory_model.js ('k') | ui/webui/resources/js/cr/ui/list.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/file_manager/file_manager/foreground/js/file_manager.js
diff --git a/ui/file_manager/file_manager/foreground/js/file_manager.js b/ui/file_manager/file_manager/foreground/js/file_manager.js
index 07aa224b3ebc1948916ff8d7abd28065e95b46f3..523c515f609e3b4c2af2efa4fe06267e9261f2c0 100644
--- a/ui/file_manager/file_manager/foreground/js/file_manager.js
+++ b/ui/file_manager/file_manager/foreground/js/file_manager.js
@@ -2844,22 +2844,37 @@ var BOTTOM_MARGIN_FOR_PREVIEW_PANEL_PX = 52;
var self = this;
var list = self.currentList_;
var tryCreate = function() {
- self.directoryModel_.createDirectory(current(),
- onSuccess, onError);
};
var onSuccess = function(entry) {
metrics.recordUserAction('CreateNewFolder');
list.selectedItem = entry;
+
+ self.table_.list.endBatchUpdates();
+ self.grid_.endBatchUpdates();
+
self.initiateRename();
};
var onError = function(error) {
+ self.table_.list.endBatchUpdates();
+ self.grid_.endBatchUpdates();
+
self.alert.show(strf('ERROR_CREATING_FOLDER', current(),
util.getFileErrorString(error.name)));
};
- tryCreate();
+ var onAbort = function() {
+ self.table_.list.endBatchUpdates();
+ self.grid_.endBatchUpdates();
+ };
+
+ this.table_.list.startBatchUpdates();
+ this.grid_.startBatchUpdates();
+ this.directoryModel_.createDirectory(current(),
+ onSuccess,
+ onError,
+ onAbort);
};
/**
« no previous file with comments | « ui/file_manager/file_manager/foreground/js/directory_model.js ('k') | ui/webui/resources/js/cr/ui/list.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698