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 20ef2123a377aa7f761057367c90214c6b9498a9..1bb990a71e9a11abbb112bce566e571befe92efe 100644 |
--- a/ui/file_manager/file_manager/foreground/js/directory_model.js |
+++ b/ui/file_manager/file_manager/foreground/js/directory_model.js |
@@ -919,10 +919,24 @@ |
var previousDirEntry = |
this.currentDirContents_.getDirectoryEntry(); |
+ this.clearAndScan_( |
+ newDirectoryContents, |
+ function(result) { |
+ // Calls the callback of the method when successful. |
+ if (result && opt_callback) |
+ opt_callback(); |
+ |
+ // Notify that the current task of this.directoryChangeQueue_ |
+ // is completed. |
+ setTimeout(queueTaskCallback, 0); |
+ }); |
+ |
+ // For tests that open the dialog to empty directories, everything |
+ // is loaded at this point. |
+ util.testSendMessage('directory-change-complete'); |
var previousVolumeInfo = |
previousDirEntry ? |
this.volumeManager_.getVolumeInfo(previousDirEntry) : null; |
- |
// VolumeInfo for dirEntry. |
var currentVolumeInfo = this.getCurrentVolumeInfo(); |
var event = new Event('directory-changed'); |
@@ -930,22 +944,6 @@ |
event.newDirEntry = dirEntry; |
event.volumeChanged = previousVolumeInfo !== currentVolumeInfo; |
this.dispatchEvent(event); |
- |
- this.clearAndScan_( |
- newDirectoryContents, |
- function(result) { |
- // Calls the callback of the method when successful. |
- if (result && opt_callback) |
- opt_callback(); |
- |
- // Notify that the current task of this.directoryChangeQueue_ |
- // is completed. |
- setTimeout(queueTaskCallback, 0); |
- }); |
- |
- // For tests that open the dialog to empty directories, everything |
- // is loaded at this point. |
- util.testSendMessage('directory-change-complete'); |
}.bind(this)); |
}.bind(this, this.changeDirectorySequence_)); |
}; |