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

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

Issue 2851213005: DevTools: brush up audits 2 launcher UI, allow multiple audit runs, introduce landing page. (Closed)
Patch Set: for landing Created 3 years, 8 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/Dialog.js
diff --git a/third_party/WebKit/Source/devtools/front_end/ui/Dialog.js b/third_party/WebKit/Source/devtools/front_end/ui/Dialog.js
index aa64dee3987564e607ec427d760f199b59b22f61..64406e77b9081cf8fdc595f0855b1db81ae3b21e 100644
--- a/third_party/WebKit/Source/devtools/front_end/ui/Dialog.js
+++ b/third_party/WebKit/Source/devtools/front_end/ui/Dialog.js
@@ -36,7 +36,7 @@ UI.Dialog = class extends UI.GlassPane {
this.contentElement.addEventListener('focus', () => this.widget().focus(), false);
this.contentElement.addEventListener('keydown', this._onKeyDown.bind(this), false);
this.setPointerEventsBehavior(UI.GlassPane.PointerEventsBehavior.BlockedByGlassPane);
- this.setSetOutsideClickCallback(event => {
+ this.setOutsideClickCallback(event => {
this.hide();
event.consume(true);
});
@@ -44,6 +44,7 @@ UI.Dialog = class extends UI.GlassPane {
this._tabIndexMap = new Map();
/** @type {?UI.WidgetFocusRestorer} */
this._focusRestorer = null;
+ this._closeOnEscape = true;
}
/**
@@ -78,6 +79,13 @@ UI.Dialog = class extends UI.GlassPane {
delete UI.Dialog._instance;
}
+ /**
+ * @param {boolean} close
+ */
+ setCloseOnEscape(close) {
+ this._closeOnEscape = close;
+ }
+
addCloseButton() {
var closeButton = this.contentElement.createChild('div', 'dialog-close-button', 'dt-close-button');
closeButton.gray = true;
@@ -111,7 +119,7 @@ UI.Dialog = class extends UI.GlassPane {
* @param {!Event} event
*/
_onKeyDown(event) {
- if (event.keyCode === UI.KeyboardShortcut.Keys.Esc.code) {
+ if (this._closeOnEscape && event.keyCode === UI.KeyboardShortcut.Keys.Esc.code) {
event.consume(true);
this.hide();
}

Powered by Google App Engine
This is Rietveld 408576698