Chromium Code Reviews| 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..b8bbe4eeb74716b2d2f206a5719dd5dc90725aef 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_(); |
|
hirono
2015/07/06 04:52:38
I think this hideSpinner_() should not hide blinki
mtomasz
2015/07/06 08:48:48
Done (in spinner_controller.js).
|
| 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,12 @@ ScanController.prototype.onSpinnerShown_ = function() { |
| this.listContainer_.startBatchUpdates(); |
| } |
| }; |
| + |
| +ScanController.prototype.hideSpinner_ = function() { |
|
hirono
2015/07/06 04:52:38
Please add /** @private */
mtomasz
2015/07/06 08:48:48
Done.
|
| + if (this.directoryModel_.isScanning() && |
| + this.directoryModel_.getFileList().length == 0) { |
| + return; |
| + } |
| + |
| + this.spinnerController_.hide(); |
| +}; |