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

Unified Diff: chrome/browser/resources/file_manager/js/directory_model.js

Issue 16351002: Fix problems when renaming and entering a directory fast in Files.app. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 6 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 | « no previous file | chrome/browser/resources/file_manager/js/file_manager.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/resources/file_manager/js/directory_model.js
diff --git a/chrome/browser/resources/file_manager/js/directory_model.js b/chrome/browser/resources/file_manager/js/directory_model.js
index cf0bc41cb5557219667fffb2104f59b9537f39a3..ddb4f6c4937ec41415c844b4d3bf00c693eae4e4 100644
--- a/chrome/browser/resources/file_manager/js/directory_model.js
+++ b/chrome/browser/resources/file_manager/js/directory_model.js
@@ -686,8 +686,13 @@ DirectoryModel.prototype.renameEntry = function(entry, newName,
var currentDirPath = this.getCurrentDirPath();
var onSuccess = function(newEntry) {
this.currentDirContents_.prefetchMetadata([newEntry], function() {
- // Do not change anything or call the callback if current
- // directory changed.
+ // If the current directory is the old entry, then quietly change to the
+ // new one.
+ if (entry.fullPath == this.getCurrentDirPath())
+ this.changeDirectory(newEntry.fullPath);
+
+ // Update selection and call the success callback if still in the same
+ // directory as while started renaming.
if (currentDirPath != this.getCurrentDirPath())
return;
« no previous file with comments | « no previous file | chrome/browser/resources/file_manager/js/file_manager.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698