Chromium Code Reviews| Index: third_party/WebKit/Source/devtools/front_end/ui/EmptyWidget.js |
| diff --git a/third_party/WebKit/Source/devtools/front_end/ui/EmptyWidget.js b/third_party/WebKit/Source/devtools/front_end/ui/EmptyWidget.js |
| index 94bde9264dcb20808450c9ca5ee0ca292925bb3a..8054bc3580b18a158fea0cdddc619e3858fe0711 100644 |
| --- a/third_party/WebKit/Source/devtools/front_end/ui/EmptyWidget.js |
| +++ b/third_party/WebKit/Source/devtools/front_end/ui/EmptyWidget.js |
| @@ -32,12 +32,19 @@ |
| * @unrestricted |
| */ |
| UI.EmptyWidget = class extends UI.VBox { |
| - constructor(text) { |
| + /** |
| + * @param {string} text |
| + * @param {?Element=} descElement |
| + */ |
| + constructor(text, descElement) { |
| super(); |
| this.registerRequiredCSS('ui/emptyWidget.css'); |
| this.element.classList.add('empty-view'); |
| - this.textElement = this.element.createChild('span'); |
| + this.textElement = this.element.createChild('h2'); |
| + this.descWrapperElement = this.element.createChild('div', 'empty-view-description'); |
| + |
| this._text = text; |
| + this._descElement = descElement; |
| } |
| /** |
| @@ -45,8 +52,15 @@ UI.EmptyWidget = class extends UI.VBox { |
| */ |
| wasShown() { |
| this.textElement.textContent = this._text; |
| + if (this._descElement) { |
|
pfeldman
2017/02/15 19:57:02
Just have it there, no need to mutate upon wasShow
paulirish
2017/02/23 01:49:30
Latest patch doesn't hold onto _text, but instead
|
| + this.descWrapperElement.removeChildren(); |
| + this.descWrapperElement.appendChild(this._descElement); |
| + } |
| } |
| + /** |
| + * @param {string} text |
| + */ |
| set text(text) { |
| this._text = text; |
| if (this.isShowing()) |