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

Unified Diff: ui/file_manager/file_manager/foreground/js/directory_model.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
Index: ui/file_manager/file_manager/foreground/js/directory_model.js
diff --git a/ui/file_manager/file_manager/foreground/js/directory_model.js b/ui/file_manager/file_manager/foreground/js/directory_model.js
index 80712072320370c0e7ffda42c951697121ca4f30..422a9f75be1d4df09193906394aa3cac2cccc974 100644
--- a/ui/file_manager/file_manager/foreground/js/directory_model.js
+++ b/ui/file_manager/file_manager/foreground/js/directory_model.js
@@ -583,10 +583,12 @@ DirectoryModel.prototype.onRenameEntry = function(
* @param {string} name Directory name.
* @param {function(DirectoryEntry)} successCallback Callback on success.
* @param {function(FileError)} errorCallback Callback on failure.
+ * @param {function()} abortCallback Callback on abort (cancelled by user).
*/
DirectoryModel.prototype.createDirectory = function(name,
successCallback,
- errorCallback) {
+ errorCallback,
+ abortCallback) {
// Obtain and check the current directory.
var entry = this.getCurrentDirEntry();
if (!entry || this.isSearching()) {
@@ -615,8 +617,10 @@ DirectoryModel.prototype.createDirectory = function(name,
// Do not change anything or call the callback if current
// directory changed.
tracker.stop();
- if (tracker.hasChanged)
+ if (tracker.hasChanged) {
+ abortCallback();
return;
+ }
// If target directory is already in the list, just select it.
var existing = this.getFileList().slice().filter(

Powered by Google App Engine
This is Rietveld 408576698