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

Unified Diff: chrome/browser/resources/options/deletable_item_list.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
Index: chrome/browser/resources/options/deletable_item_list.js
diff --git a/chrome/browser/resources/options/deletable_item_list.js b/chrome/browser/resources/options/deletable_item_list.js
index e4ea7747df37ee11b9bd92c407a74b20f9985fa2..a3721fd2b172b5a0b7e3d6a9f5acdb71f51a15db 100644
--- a/chrome/browser/resources/options/deletable_item_list.js
+++ b/chrome/browser/resources/options/deletable_item_list.js
@@ -31,7 +31,7 @@ cr.define('options', function() {
__proto__: ListItem.prototype,
/**
- * The list item being wrapped to make in deletable.
+ * The list item being wrapped to make it deletable.
* @type {!ListItem}
* @private
*/
@@ -41,23 +41,29 @@ cr.define('options', function() {
decorate: function() {
ListItem.prototype.decorate.call(this);
- this.className = 'deletable-item';
- var contentEl = this.ownerDocument.createElement('div');
- contentEl.appendChild(this.baseItem_);
+ this.baseItem_.classList.add('deletable-item');
+ this.appendChild(this.baseItem_);
+
var closeButtonEl = this.ownerDocument.createElement('button');
closeButtonEl.className = 'close-button';
-
- this.appendChild(contentEl);
this.appendChild(closeButtonEl);
},
+ /** @inheritDoc */
+ selectionChanged: function() {
+ // Forward the selection state to the |baseItem_|.
+ // TODO(jhawkins): This is terrible.
+ this.baseItem_.selected = this.selected;
+ this.baseItem_.selectionChanged();
+ },
+
/**
- * Returns the list item being wrapped to make in deletable.
+ * Returns the list item being wrapped to make it deletable.
* @return {!ListItem} The list item being wrapped
*/
get contentItem() {
return this.baseItem_;
- }
+ },
};
var DeletableItemList = cr.ui.define('list');
@@ -107,7 +113,7 @@ cr.define('options', function() {
/**
* Called when an item should be deleted; subclasses are responsible for
* implementing.
- * @param {number} index The indexd of the item that is being deleted.
+ * @param {number} index The index of the item that is being deleted.
*/
deleteItemAtIndex: function(index) {
},
« no previous file with comments | « chrome/browser/dom_ui/options/password_manager_handler.cc ('k') | chrome/browser/resources/options/options.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698