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 c77f8e30c8a2b9..6c3a86f3d3edaa 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} diff --git a/third_party/WebKit/Source/devtools/front_end/audits2/audits2Panel.css b/third_party/WebKit/Source/devtools/front_end/audits2/audits2Panel.css index f4538ea5ede4f6..be988c420a205b 100644 --- a/third_party/WebKit/Source/devtools/front_end/audits2/audits2Panel.css +++ b/third_party/WebKit/Source/devtools/front_end/audits2/audits2Panel.css @@ -22,6 +22,7 @@ display: flex; align-items: center; justify-content: center; + overflow: auto; } @@ -33,6 +34,10 @@ margin: 50px; } +.audits2-landing-center > * { + flex-shrink: 0; +} + .audits2-landing-text { color: #666; } diff --git a/third_party/WebKit/Source/devtools/front_end/ui/inspectorCommon.css b/third_party/WebKit/Source/devtools/front_end/ui/inspectorCommon.css index 14d1ea02c8f9fb..0163cbb120d413 100644 --- a/third_party/WebKit/Source/devtools/front_end/ui/inspectorCommon.css +++ b/third_party/WebKit/Source/devtools/front_end/ui/inspectorCommon.css @@ -397,6 +397,11 @@ button.material-button.default { background-color: #4285f4 !important; } +button.material-button.default:disabled { + background-color: #ffffff !important; + color: gray; +} + button.material-button.default:not(:disabled):hover { background-color: hsla(217, 89%, 58%, 1) !important; color: white !important;