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

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

Issue 15806002: Files.app: Fixed a bug of moving multiple files. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 7 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/resources/file_manager/js/file_copy_manager.js
diff --git a/chrome/browser/resources/file_manager/js/file_copy_manager.js b/chrome/browser/resources/file_manager/js/file_copy_manager.js
index 5fc4f3be12a5452a017484f3951fcb527fff7f5b..b29bd499fd5c2cabc91cae58bcee0ba1bac3f277 100644
--- a/chrome/browser/resources/file_manager/js/file_copy_manager.js
+++ b/chrome/browser/resources/file_manager/js/file_copy_manager.js
@@ -89,7 +89,9 @@ FileCopyManager.Task.prototype.setEntries = function(entries, callback) {
var self = this;
var onEntriesRecursed = function(result) {
- self.pendingDirectories = result.dirEntries;
+ // Deeper directory is moved earier.
+ self.pendingDirectories = result.dirEntries.sort(
+ function(a, b) { return a.fullPath < b.fullPath; });
self.pendingFiles = result.fileEntries;
self.pendingBytes = result.fileBytes;
callback();
@@ -109,16 +111,14 @@ FileCopyManager.Task.prototype.getNextEntry = function() {
// We should keep the file in pending list and remove it after complete.
// Otherwise, if we try to get status in the middle of copying. The returned
// status is wrong (miss count the pasting item in totalItems).
- if (this.pendingDirectories.length) {
- this.pendingDirectories[0].inProgress = true;
- return this.pendingDirectories[0];
- }
-
if (this.pendingFiles.length) {
this.pendingFiles[0].inProgress = true;
return this.pendingFiles[0];
}
-
+ if (this.pendingDirectories.length) {
+ this.pendingDirectories[0].inProgress = true;
+ return this.pendingDirectories[0];
+ }
return null;
};
« 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