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

Unified Diff: ui/webui/resources/js/cr/ui/list.js

Issue 275493006: Files.app: Fix selection on creating new folder (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Add a test Created 6 years, 7 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/webui/resources/js/cr/ui/list.js
diff --git a/ui/webui/resources/js/cr/ui/list.js b/ui/webui/resources/js/cr/ui/list.js
index 3f1d1a84f382eaa615053645bd8ed848458a6776..240bd6e901033fe5a4739519fbf9e56efcd87a68 100644
--- a/ui/webui/resources/js/cr/ui/list.js
+++ b/ui/webui/resources/js/cr/ui/list.js
@@ -1121,14 +1121,11 @@ cr.define('cr.ui', function() {
// We don't set the lead or selected properties until after adding all
// items, in case they force relayout in response to these events.
- var listItem = null;
if (leadIndex != -1 && this.cachedItems_[leadIndex])
this.cachedItems_[leadIndex].lead = true;
for (var y = firstIndex; y < lastIndex; y++) {
- if (sm.getIndexSelected(y))
- this.cachedItems_[y].selected = true;
- else if (y != leadIndex)
- listItem = this.cachedItems_[y];
+ if (sm.getIndexSelected(y) != this.cachedItems_[y].selected)
+ this.cachedItems_[y].selected = !this.cachedItems_[y].selected;
hirono 2014/05/09 07:29:38 nit: How about this.cachedItems_[y].selected = sm.
yoshiki 2014/05/09 13:54:17 getIndexSelected() may be heavy if it's overridden
}
this.firstIndex_ = firstIndex;

Powered by Google App Engine
This is Rietveld 408576698