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

Unified Diff: chrome/browser/resources/shared/js/cr/ui/list_single_selection_model.js

Issue 9705015: Making the selectedIndex property setters of ListSelectionModel and ListSingleSelectionModel behave… (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 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
« no previous file with comments | « chrome/browser/resources/shared/js/cr/ui/list_selection_model.js ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/resources/shared/js/cr/ui/list_single_selection_model.js
diff --git a/chrome/browser/resources/shared/js/cr/ui/list_single_selection_model.js b/chrome/browser/resources/shared/js/cr/ui/list_single_selection_model.js
index 2cf43a92ca9b9c88dc1759590cde51313316eb6a..ad1f72ae647555030de973ab224d4e093c90f748 100644
--- a/chrome/browser/resources/shared/js/cr/ui/list_single_selection_model.js
+++ b/chrome/browser/resources/shared/js/cr/ui/list_single_selection_model.js
@@ -41,6 +41,7 @@ cr.define('cr.ui', function() {
/**
* Convenience getter which returns the first selected index.
+ * Setter also changes lead and anchor indexes if value is nonegative.
* @type {number}
*/
get selectedIndex() {
@@ -52,7 +53,9 @@ cr.define('cr.ui', function() {
if (i != oldSelectedIndex) {
this.beginChange();
- this.selectedIndex_ = i
+ this.selectedIndex_ = i;
+ if (i >= 0)
+ this.leadIndex = i;
this.endChange();
}
},
« no previous file with comments | « chrome/browser/resources/shared/js/cr/ui/list_selection_model.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698