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

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

Issue 943473002: Dispatch directory-changed event before rescan starts. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 10 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: 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 1bb990a71e9a11abbb112bce566e571befe92efe..20ef2123a377aa7f761057367c90214c6b9498a9 100644
--- a/ui/file_manager/file_manager/foreground/js/directory_model.js
+++ b/ui/file_manager/file_manager/foreground/js/directory_model.js
@@ -919,6 +919,18 @@ DirectoryModel.prototype.changeDirectoryEntry = function(
var previousDirEntry =
this.currentDirContents_.getDirectoryEntry();
+ var previousVolumeInfo =
+ previousDirEntry ?
+ this.volumeManager_.getVolumeInfo(previousDirEntry) : null;
+
+ // VolumeInfo for dirEntry.
+ var currentVolumeInfo = this.getCurrentVolumeInfo();
+ var event = new Event('directory-changed');
+ event.previousDirEntry = previousDirEntry;
+ event.newDirEntry = dirEntry;
+ event.volumeChanged = previousVolumeInfo !== currentVolumeInfo;
+ this.dispatchEvent(event);
+
this.clearAndScan_(
newDirectoryContents,
function(result) {
@@ -934,16 +946,6 @@ DirectoryModel.prototype.changeDirectoryEntry = function(
// 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');
- event.previousDirEntry = previousDirEntry;
- event.newDirEntry = dirEntry;
- event.volumeChanged = previousVolumeInfo !== currentVolumeInfo;
- this.dispatchEvent(event);
}.bind(this));
}.bind(this, this.changeDirectorySequence_));
};
« 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