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

Unified Diff: third_party/WebKit/Source/devtools/front_end/audits2/Audits2Panel.js

Issue 2890613004: DevTools: ui polish for the audits2 panel. (Closed)
Patch Set: Created 3 years, 7 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
« no previous file with comments | « no previous file | third_party/WebKit/Source/devtools/front_end/audits2/audits2Panel.css » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/devtools/front_end/audits2/Audits2Panel.js
diff --git a/third_party/WebKit/Source/devtools/front_end/audits2/Audits2Panel.js b/third_party/WebKit/Source/devtools/front_end/audits2/Audits2Panel.js
index 6221c8fe1e84f6d146bb821d3699fab06e7801b3..27bdb1fd5c6f727ad623c3b0424e3a90c3eeed81 100644
--- a/third_party/WebKit/Source/devtools/front_end/audits2/Audits2Panel.js
+++ b/third_party/WebKit/Source/devtools/front_end/audits2/Audits2Panel.js
@@ -40,6 +40,8 @@ Audits2.Audits2Panel = class extends UI.PanelWithSidebar {
this.contentElement, [UI.DropTarget.Types.Files], Common.UIString('Drop audit file here'),
this._handleDrop.bind(this));
+ for (var preset of Audits2.Audits2Panel.Presets)
+ preset.setting.addChangeListener(this._updateStartButtonEnabled.bind(this));
this._showLandingPage();
}
@@ -103,6 +105,7 @@ Audits2.Audits2Panel = class extends UI.PanelWithSidebar {
var buttonsRow = uiElement.createChild('div', 'audits2-dialog-buttons hbox');
this._startButton =
UI.createTextButton(Common.UIString('Run audit'), this._start.bind(this), 'material-button default');
+ this._updateStartButtonEnabled();
buttonsRow.appendChild(this._startButton);
this._cancelButton = UI.createTextButton(Common.UIString('Cancel'), this._cancel.bind(this), 'material-button');
buttonsRow.appendChild(this._cancelButton);
@@ -114,6 +117,18 @@ Audits2.Audits2Panel = class extends UI.PanelWithSidebar {
auditsViewElement.focus();
}
+ _updateStartButtonEnabled() {
+ if (!this._startButton)
+ return;
+ for (var preset of Audits2.Audits2Panel.Presets) {
+ if (preset.setting.get()) {
+ this._startButton.disabled = false;
+ return;
+ }
+ }
+ this._startButton.disabled = true;
+ }
+
/**
* @param {!Element} launcherUIElement
* @return {!Element}
« no previous file with comments | « no previous file | third_party/WebKit/Source/devtools/front_end/audits2/audits2Panel.css » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698