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

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

Issue 969763002: Files.app: Prevent shadow animation of grid items on redraw. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix typo in the comment. Created 5 years, 10 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 | « no previous file | ui/file_manager/file_manager/foreground/js/ui/file_table_list.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/file_manager/file_manager/foreground/js/ui/file_grid.js
diff --git a/ui/file_manager/file_manager/foreground/js/ui/file_grid.js b/ui/file_manager/file_manager/foreground/js/ui/file_grid.js
index db001f078038eca50e5ad20caf488987df4eac70..57a47d2a8ed0fefc849faaad87fe9c7cbb071860 100644
--- a/ui/file_manager/file_manager/foreground/js/ui/file_grid.js
+++ b/ui/file_manager/file_manager/foreground/js/ui/file_grid.js
@@ -107,6 +107,18 @@ FileGrid.prototype.onThumbnailLoaded_ = function(event) {
FileGrid.prototype.mergeItems = function(beginIndex, endIndex) {
cr.ui.Grid.prototype.mergeItems.call(this, beginIndex, endIndex);
+ // Make sure that grid item's selected attribute is updated just after the
+ // mergeItems operation is done. This prevents shadow of selected grid items
+ // from being animated unintentionally by redraw.
+ for (var i = beginIndex; i < endIndex; i++) {
+ var item = this.getListItemByIndex(i);
+ if (!item)
+ continue;
+ var isSelected = this.selectionModel.getIndexSelected(i);
+ if (item.selected != isSelected)
+ item.selected = isSelected;
+ }
+
// Keep these values to set range when a new list thumbnail loader is set.
this.beginIndex_ = beginIndex;
this.endIndex_ = endIndex;
« no previous file with comments | « no previous file | ui/file_manager/file_manager/foreground/js/ui/file_table_list.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698