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

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

Issue 10824277: In FileManager send 'on-completed' event only when a scan is completed. Send 'on-cancelled' event w… (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 4 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 | « chrome/browser/resources/file_manager/js/directory_model.js ('k') | 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_manager.js
diff --git a/chrome/browser/resources/file_manager/js/file_manager.js b/chrome/browser/resources/file_manager/js/file_manager.js
index 9e1e42ca341cb67d402581930e969cf058e4d951..fb6c2c863f6701cc478f4fd1975fe53792de6937 100644
--- a/chrome/browser/resources/file_manager/js/file_manager.js
+++ b/chrome/browser/resources/file_manager/js/file_manager.js
@@ -438,6 +438,7 @@ FileManager.prototype = {
});
dm.addEventListener('scan-started', this.showSpinnerLater_.bind(this));
dm.addEventListener('scan-completed', this.showSpinner_.bind(this, false));
+ dm.addEventListener('scan-cancelled', this.hideSpinnerLater_.bind(this));
dm.addEventListener('scan-completed',
this.refreshCurrentDirectoryMetadata_.bind(this));
dm.addEventListener('rescan-completed',
@@ -3235,15 +3236,22 @@ FileManager.prototype = {
setTimeout(this.showSpinner_.bind(this, true), 500);
};
+ FileManager.prototype.hideSpinnerLater_ = function() {
+ setTimeout(this.showSpinner_.bind(this, false), 100);
+ };
+
FileManager.prototype.showSpinner_ = function(on) {
- this.cancelSpinnerTimeout_();
- if (on) {
+ if (on && this.directoryModel_ && this.directoryModel_.isScanning()) {
if (this.directoryModel_.isSearching()) {
this.dialogContainer_.classList.add('searching');
+ this.spinner_.style.display = 'none';
} else {
this.spinner_.style.display = '';
+ this.dialogContainer_.classList.remove('searching');
}
- } else {
+ }
+
+ if (!on && (!this.directoryModel_ || !this.directoryModel_.isScanning())) {
this.spinner_.style.display = 'none';
if (this.dialogContainer_)
this.dialogContainer_.classList.remove('searching');
« no previous file with comments | « chrome/browser/resources/file_manager/js/directory_model.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698