Index: Source/devtools/front_end/Dialog.js |
diff --git a/Source/devtools/front_end/Dialog.js b/Source/devtools/front_end/Dialog.js |
index 7e9406dbf5a08d2452e8e81826cae1f405448e38..29a548c5c55046f43efaa8f38aca2741cbc81328 100644 |
--- a/Source/devtools/front_end/Dialog.js |
+++ b/Source/devtools/front_end/Dialog.js |
@@ -42,6 +42,7 @@ WebInspector.Dialog = function(relativeToElement, delegate) |
// Install glass pane capturing events. |
this._glassPane.element.tabIndex = 0; |
this._glassPane.element.addEventListener("focus", this._onGlassPaneFocus.bind(this), false); |
+ this._glassPane.element.addEventListener("keydown", this._onGlassPaneKeyDown.bind(this), false); |
this._element = this._glassPane.element.createChild("div"); |
this._element.tabIndex = 0; |
@@ -102,6 +103,20 @@ WebInspector.Dialog.prototype = { |
this._hide(); |
}, |
+ /** |
+ * @param {?Event} event |
+ */ |
+ _onGlassPaneKeyDown: function(event) |
+ { |
+ var actions = WebInspector.KeyboardShortcut.applicableActions(/** @type {!KeyboardEvent} */ (event)); |
+ for (var i = 0; i < actions.length; ++i) { |
+ if (actions[i].descriptor()["executeInDialog"]) |
+ return; |
+ } |
+ if (actions.length) |
+ event.consume(true); |
+ }, |
+ |
_onFocus: function(event) |
{ |
this._delegate.focus(); |