| Index: third_party/WebKit/Source/devtools/front_end/sources/UIList.js
|
| diff --git a/third_party/WebKit/Source/devtools/front_end/sources/UIList.js b/third_party/WebKit/Source/devtools/front_end/sources/UIList.js
|
| index 34f5957d6bd7bfeb571856609f53e3681ee860cd..a62787e9db74f3eb44b1298ce4765127c5d2b2f8 100644
|
| --- a/third_party/WebKit/Source/devtools/front_end/sources/UIList.js
|
| +++ b/third_party/WebKit/Source/devtools/front_end/sources/UIList.js
|
| @@ -84,7 +84,8 @@ WebInspector.UIList.Item = class {
|
|
|
| this.titleElement = this.element.createChild('div', 'title');
|
| this.subtitleElement = this.element.createChild('div', 'subtitle');
|
| -
|
| + /** @type {?Element} */
|
| + this._actionElement = null;
|
| this._hidden = false;
|
| this._isLabel = !!isLabel;
|
| this.setTitle(title);
|
| @@ -199,7 +200,7 @@ WebInspector.UIList.Item = class {
|
| * @param {boolean} x
|
| */
|
| setDimmed(x) {
|
| - this.element.classList.toggle('dimmed', x);
|
| + this.element.classList.toggle('dimmed-item', x);
|
| }
|
|
|
| discard() {
|
| @@ -211,4 +212,23 @@ WebInspector.UIList.Item = class {
|
| setHoverable(hoverable) {
|
| this.element.classList.toggle('ignore-hover', !hoverable);
|
| }
|
| +
|
| + /**
|
| + * @param {?string} title
|
| + * @param {?function(!Event):!Promise} handler
|
| + */
|
| + setAction(title, handler) {
|
| + if (this._actionElement)
|
| + this._actionElement.remove();
|
| + if (!title || !handler)
|
| + return;
|
| + this._actionElement = this.element.createChild('div', 'action');
|
| + var link = this._actionElement.createChild('a', 'action-link');
|
| + link.textContent = title;
|
| + link.addEventListener('click', (event) => {
|
| + link.disabled = true;
|
| + handler(event).then(() => link.disabled = false);
|
| + event.stopPropagation();
|
| + });
|
| + }
|
| };
|
|
|