Commit 0e0b8ff5 authored by Luciano Pacheco's avatar Luciano Pacheco Committed by Commit Bot

Move command updateAvailability()

Move updateAvailability() call to be outside of list container batch.
Command updateAvailability function does several checks for all
commands to set them as available or not, makes sense to perform this
outside of the batch, so moved the call after list container batch.

The only thing that can potentially change is that file list can finish
drawing before the commands have fully set their availability, but that
shouldn't be a problem for users.

Change-Id: I192411dca3a8d3d02c4319d17b46f65df50f4ef1
Reviewed-on: https://chromium-review.googlesource.com/1229724Reviewed-by: default avatarJoel Hockey <joelhockey@chromium.org>
Commit-Queue: Luciano Pacheco <lucmult@chromium.org>
Cr-Commit-Position: refs/heads/master@{#591983}
parent 8508e938
......@@ -120,9 +120,6 @@ ScanController.prototype.onScanCompleted_ = function() {
return;
}
if (this.commandHandler_)
this.commandHandler_.updateAvailability();
this.hideSpinner_();
if (this.scanUpdatedTimer_) {
......@@ -132,6 +129,9 @@ ScanController.prototype.onScanCompleted_ = function() {
this.scanInProgress_ = false;
this.listContainer_.endBatchUpdates();
if (this.commandHandler_)
this.commandHandler_.updateAvailability();
};
/**
......@@ -169,9 +169,6 @@ ScanController.prototype.onScanCancelled_ = function() {
return;
}
if (this.commandHandler_)
this.commandHandler_.updateAvailability();
this.hideSpinner_();
if (this.scanUpdatedTimer_) {
......@@ -181,6 +178,9 @@ ScanController.prototype.onScanCancelled_ = function() {
this.scanInProgress_ = false;
this.listContainer_.endBatchUpdates();
if (this.commandHandler_)
this.commandHandler_.updateAvailability();
};
/**
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment