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

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

Issue 5935003: DOMUI: Implement new-style password manager. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Selection transitions. Created 10 years 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.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_item.js
diff --git a/chrome/browser/resources/shared/js/cr/ui/list_item.js b/chrome/browser/resources/shared/js/cr/ui/list_item.js
index 283216f9b2bea2e217d9d83f64683ae00585f060..11a8de33aed4ca82bfb22e124cbd94ae2df95f05 100644
--- a/chrome/browser/resources/shared/js/cr/ui/list_item.js
+++ b/chrome/browser/resources/shared/js/cr/ui/list_item.js
@@ -27,10 +27,38 @@ cr.define('cr.ui', function() {
},
/**
+ * The current selection state.
+ * @type {Boolean}
+ */
+ get selected() {
+ return this.hasAttribute('selected');
+ },
+ set selected(selected) {
+ selected = Boolean(selected);
+ var oldSelected = this.selected;
+ if (oldSelected == selected)
+ return;
+
+ if (selected)
+ this.setAttribute('selected', '');
+ else
+ this.removeAttribute('selected');
+
+ cr.dispatchPropertyChange(this, 'selected', selected, oldSelected);
+ this.selectionChanged();
+ },
+
+ /**
* Called when an element is decorated as a list item.
*/
decorate: function() {
- }
+ },
+
+ /**
+ * Called when the selection state of this element changes.
+ */
+ selectionChanged: function() {
+ },
};
/**
« no previous file with comments | « chrome/browser/resources/shared/js/cr/ui/list.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698