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

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

Issue 2693193006: DevTools: Show docs link on empty manifest landing page (Closed)
Patch Set: tweak text. max-width 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/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())

Powered by Google App Engine
This is Rietveld 408576698