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

Side by Side Diff: chrome/browser/resources/options/deletable_item_list.js

Issue 570503002: Compile chrome://settings, part 6 (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@H_options_errors_4
Patch Set: fix asserts, rebase Created 6 years, 3 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 cr.define('options', function() { 5 cr.define('options', function() {
6 /** @const */ var List = cr.ui.List; 6 /** @const */ var List = cr.ui.List;
7 /** @const */ var ListItem = cr.ui.ListItem; 7 /** @const */ var ListItem = cr.ui.ListItem;
8 8
9 /** 9 /**
10 * Creates a deletable list item, which has a button that will trigger a call 10 * Creates a deletable list item, which has a button that will trigger a call
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after
145 * Callback for onclick events. 145 * Callback for onclick events.
146 * @param {Event} e The click event object. 146 * @param {Event} e The click event object.
147 * @override 147 * @override
148 */ 148 */
149 handleClick: function(e) { 149 handleClick: function(e) {
150 if (this.disabled) 150 if (this.disabled)
151 return; 151 return;
152 152
153 var target = e.target; 153 var target = e.target;
154 if (target.classList.contains('row-delete-button')) { 154 if (target.classList.contains('row-delete-button')) {
155 var listItem = this.getListItemAncestor(target); 155 var listItem = this.getListItemAncestor(
156 /** @type {HTMLElement} */(target));
156 var idx = this.getIndexOfListItem(listItem); 157 var idx = this.getIndexOfListItem(listItem);
157 this.deleteItemAtIndex(idx); 158 this.deleteItemAtIndex(idx);
158 } 159 }
159 }, 160 },
160 161
161 /** 162 /**
162 * Callback for keydown events. 163 * Callback for keydown events.
163 * @param {Event} e The keydown event object. 164 * @param {Event} e The keydown event object.
164 * @private 165 * @private
165 */ 166 */
(...skipping 30 matching lines...) Expand all
196 */ 197 */
197 deleteItemAtIndex: function(index) { 198 deleteItemAtIndex: function(index) {
198 }, 199 },
199 }; 200 };
200 201
201 return { 202 return {
202 DeletableItemList: DeletableItemList, 203 DeletableItemList: DeletableItemList,
203 DeletableItem: DeletableItem, 204 DeletableItem: DeletableItem,
204 }; 205 };
205 }); 206 });
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698