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

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

Issue 1222563005: Implement refreshing logic in Files app. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebased. Created 5 years, 5 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
Index: ui/file_manager/file_manager/foreground/js/scan_controller.js
diff --git a/ui/file_manager/file_manager/foreground/js/scan_controller.js b/ui/file_manager/file_manager/foreground/js/scan_controller.js
index 9d65b02733433b5faecfd1a6287b7e8bf3a55471..8626058926d87d4e3dd85c5689404ceb3a557839 100644
--- a/ui/file_manager/file_manager/foreground/js/scan_controller.js
+++ b/ui/file_manager/file_manager/foreground/js/scan_controller.js
@@ -133,7 +133,8 @@ ScanController.prototype.onScanStarted_ = function() {
this.scanUpdatedTimer_ = 0;
}
- this.spinnerController_.showLater();
+ if (this.directoryModel_.isScanning())
+ this.spinnerController_.showLater();
};
/**
@@ -147,7 +148,7 @@ ScanController.prototype.onScanCompleted_ = function() {
if (this.commandHandler_)
this.commandHandler_.updateAvailability();
- this.spinnerController_.hide();
+ this.hideSpinner_();
if (this.scanUpdatedTimer_) {
clearTimeout(this.scanUpdatedTimer_);
@@ -186,7 +187,7 @@ ScanController.prototype.onScanUpdated_ = function() {
// We need to hide the spinner only once.
if (!this.scanUpdatedAtLeastOnceOrCompleted_) {
this.scanUpdatedAtLeastOnceOrCompleted_ = true;
- this.spinnerController_.hide();
+ this.hideSpinner_();
}
// Update the UI.
@@ -209,7 +210,7 @@ ScanController.prototype.onScanCancelled_ = function() {
if (this.commandHandler_)
this.commandHandler_.updateAvailability();
- this.spinnerController_.hide();
+ this.hideSpinner_();
if (this.scanCompletedTimer_) {
clearTimeout(this.scanCompletedTimer_);
this.scanCompletedTimer_ = 0;
@@ -262,3 +263,14 @@ ScanController.prototype.onSpinnerShown_ = function() {
this.listContainer_.startBatchUpdates();
}
};
+
+/**
+ * @private
+ */
+ScanController.prototype.hideSpinner_ = function() {
+ if (this.directoryModel_.isScanning() &&
+ this.directoryModel_.getFileList().length == 0) {
+ return;
+ }
+ this.spinnerController_.hide();
+};

Powered by Google App Engine
This is Rietveld 408576698