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

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

Issue 2688153003: DevTools: fix blackboxing buttons (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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/devtools/front_end/ui/ListWidget.js
diff --git a/third_party/WebKit/Source/devtools/front_end/ui/ListWidget.js b/third_party/WebKit/Source/devtools/front_end/ui/ListWidget.js
index 8593e998edf78f90e4d028e5e5e5dd160edfb908..6a3a19e79b0779cf4c49ae3b795c79aecddc3c12 100644
--- a/third_party/WebKit/Source/devtools/front_end/ui/ListWidget.js
+++ b/third_party/WebKit/Source/devtools/front_end/ui/ListWidget.js
@@ -115,37 +115,34 @@ UI.ListWidget = class extends UI.VBox {
_createControls(item, element) {
var controls = createElementWithClass('div', 'controls-container fill');
controls.createChild('div', 'controls-gradient');
+
var buttons = controls.createChild('div', 'controls-buttons');
- var editButton = UI.Icon.create('largeicon-edit', 'edit-button');
- buttons.appendChild(editButton);
- editButton.title = Common.UIString('Edit');
- editButton.addEventListener('click', onEditClicked.bind(this), false);
+ var toolbar = new UI.Toolbar('', buttons);
+
+ var editButton = new UI.ToolbarButton(Common.UIString('Edit'), 'largeicon-edit');
+ editButton.addEventListener(UI.ToolbarButton.Events.Click, onEditClicked.bind(this));
+ toolbar.appendToolbarItem(editButton);
- var removeButton = UI.Icon.create('largeicon-trash-bin', 'remove-button');
- buttons.appendChild(removeButton);
- removeButton.title = Common.UIString('Remove');
- removeButton.addEventListener('click', onRemoveClicked.bind(this), false);
+ var removeButton = new UI.ToolbarButton(Common.UIString('Remove'), 'largeicon-trash-bin');
+ removeButton.addEventListener(UI.ToolbarButton.Events.Click, onRemoveClicked.bind(this));
+ toolbar.appendToolbarItem(removeButton);
return controls;
/**
- * @param {!Event} event
* @this {UI.ListWidget}
*/
- function onEditClicked(event) {
- event.consume();
+ function onEditClicked() {
var index = this._elements.indexOf(element);
var insertionPoint = this._elements[index + 1] || null;
this._startEditing(item, element, insertionPoint);
}
/**
- * @param {!Event} event
* @this {UI.ListWidget}
*/
- function onRemoveClicked(event) {
- event.consume();
+ function onRemoveClicked() {
var index = this._elements.indexOf(element);
this._delegate.removeItemRequested(this._items[index], index);
}

Powered by Google App Engine
This is Rietveld 408576698