| 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();
|
| }
|
|
|