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

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

Issue 1009313004: Files.app: Show details of drive sync progress. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix nit. Created 5 years, 9 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/progress_center_item_group.js
diff --git a/ui/file_manager/file_manager/foreground/js/progress_center_item_group.js b/ui/file_manager/file_manager/foreground/js/progress_center_item_group.js
index d08cd6fd17886318aa9bd83bbccb969d4df228ac..67265fc12ecd6de5f711c9b3ee3fcd008fd4a4e2 100644
--- a/ui/file_manager/file_manager/foreground/js/progress_center_item_group.js
+++ b/ui/file_manager/file_manager/foreground/js/progress_center_item_group.js
@@ -130,17 +130,25 @@ ProgressCenterItemGroup.getSummarizedErrorItem = function(var_args) {
};
/**
- * Obtains Whether the item should be animated or not.
+ * Obtains whether the item should be animated or not.
* @param {boolean} previousAnimated Whether the item is previously animated or
* not.
* @param {ProgressCenterItem} previousItem Item before updating.
* @param {ProgressCenterItem} item New item.
+ * @param {boolean} summarized If the item is summarized one or not.
* @return {boolean} Whether the item should be animated or not.
* @private
*/
ProgressCenterItemGroup.shouldAnimate_ = function(
- previousAnimated, previousItem, item) {
- if (!previousItem || !item || previousItem.quiet || item.quiet)
+ previousAnimated, previousItem, item, summarized) {
+ // Check visibility of previous and current progress bar.
+ var previousShow =
+ previousItem && (!summarized || !previousItem.quiet);
+ var currentShow =
+ item && (!summarized || !item.quiet);
+ // If previous or current item does not show progress bar, we should not
+ // animate.
+ if (!previousShow || !currentShow)
return false;
if (previousItem.progressRateInPercent < item.progressRateInPercent)
return true;
@@ -233,7 +241,8 @@ ProgressCenterItemGroup.prototype.update = function(item) {
this.animated_[item.id] = ProgressCenterItemGroup.shouldAnimate_(
!!this.animated_[item.id],
previousItem,
- item);
+ item,
+ /* summarized */ false);
if (!this.animated_[item.id])
this.completeItemAnimation(item.id);
break;
@@ -253,7 +262,8 @@ ProgressCenterItemGroup.prototype.update = function(item) {
this.summarizedItemAnimated_ = ProgressCenterItemGroup.shouldAnimate_(
!!this.summarizedItemAnimated_,
previousSummarizedItem,
- this.summarizedItem_);
+ this.summarizedItem_,
+ /* summarized */ true);
if (!this.summarizedItemAnimated_)
this.completeSummarizedItemAnimation();
};

Powered by Google App Engine
This is Rietveld 408576698