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

Side by Side Diff: third_party/WebKit/Source/devtools/front_end/ui/ListWidget.js

Issue 2652173002: DevTools: migrate UI.ListWidget icons over to UI.Icon (Closed)
Patch Set: Created 3 years, 10 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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 * @unrestricted 5 * @unrestricted
6 */ 6 */
7 UI.ListWidget = class extends UI.VBox { 7 UI.ListWidget = class extends UI.VBox {
8 /** 8 /**
9 * @param {!UI.ListWidget.Delegate} delegate 9 * @param {!UI.ListWidget.Delegate} delegate
10 */ 10 */
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after
110 /** 110 /**
111 * @param {*} item 111 * @param {*} item
112 * @param {!Element} element 112 * @param {!Element} element
113 * @return {!Element} 113 * @return {!Element}
114 */ 114 */
115 _createControls(item, element) { 115 _createControls(item, element) {
116 var controls = createElementWithClass('div', 'controls-container fill'); 116 var controls = createElementWithClass('div', 'controls-container fill');
117 controls.createChild('div', 'controls-gradient'); 117 controls.createChild('div', 'controls-gradient');
118 var buttons = controls.createChild('div', 'controls-buttons'); 118 var buttons = controls.createChild('div', 'controls-buttons');
119 119
120 var editButton = buttons.createChild('div', 'edit-button'); 120 var editButton = UI.Icon.create('largeicon-edit', 'edit-button');
121 buttons.appendChild(editButton);
121 editButton.title = Common.UIString('Edit'); 122 editButton.title = Common.UIString('Edit');
122 editButton.addEventListener('click', onEditClicked.bind(this), false); 123 editButton.addEventListener('click', onEditClicked.bind(this), false);
123 124
124 var removeButton = buttons.createChild('div', 'remove-button'); 125 var removeButton = UI.Icon.create('largeicon-trash-bin', 'remove-button');
126 buttons.appendChild(removeButton);
125 removeButton.title = Common.UIString('Remove'); 127 removeButton.title = Common.UIString('Remove');
126 removeButton.addEventListener('click', onRemoveClicked.bind(this), false); 128 removeButton.addEventListener('click', onRemoveClicked.bind(this), false);
127 129
128 return controls; 130 return controls;
129 131
130 /** 132 /**
131 * @param {!Event} event 133 * @param {!Event} event
132 * @this {UI.ListWidget} 134 * @this {UI.ListWidget}
133 */ 135 */
134 function onEditClicked(event) { 136 function onEditClicked(event) {
(...skipping 264 matching lines...) Expand 10 before | Expand all | Expand 10 after
399 401
400 _cancelClicked() { 402 _cancelClicked() {
401 var cancel = this._cancel; 403 var cancel = this._cancel;
402 this._commit = null; 404 this._commit = null;
403 this._cancel = null; 405 this._cancel = null;
404 this._item = null; 406 this._item = null;
405 this._index = -1; 407 this._index = -1;
406 cancel(); 408 cancel();
407 } 409 }
408 }; 410 };
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698