| 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}
|
|
|