Add namespacing for keyboard shortcut disabling The gr-overlay element attempts to manage disabling and enabling keyboard shortcuts. When multiple gr-overlay elements are available on a page and one of them opens immediately, that overlay tries to disable keyboard shortcuts, but the other elements initialize as closed and enable them. This change offers a new method for disabling keyboard shortcuts. The caller can pass in an identifier to enable or disable. If keyboard shortcuts are disabled by one or more identifiers, then they are suppressed. Change-Id: I82fe6efd922f09279e76a2f2c8cb5781f3afe395
diff --git a/polygerrit-ui/app/elements/change/gr-change-view/gr-change-view.js b/polygerrit-ui/app/elements/change/gr-change-view/gr-change-view.js index 3d1cac7e..c794a4e 100644 --- a/polygerrit-ui/app/elements/change/gr-change-view/gr-change-view.js +++ b/polygerrit-ui/app/elements/change/gr-change-view/gr-change-view.js
@@ -585,7 +585,7 @@ }, _handleKey: function(e) { - if (this.shouldSupressKeyboardShortcut(e)) { return; } + if (this.shouldSuppressKeyboardShortcut(e)) { return; } switch (e.keyCode) { case 65: // 'a' if (this._loggedIn && !e.shiftKey) {
diff --git a/polygerrit-ui/app/elements/change/gr-file-list/gr-file-list.js b/polygerrit-ui/app/elements/change/gr-file-list/gr-file-list.js index 478faf5..22c82a0 100644 --- a/polygerrit-ui/app/elements/change/gr-file-list/gr-file-list.js +++ b/polygerrit-ui/app/elements/change/gr-file-list/gr-file-list.js
@@ -295,7 +295,7 @@ }, _handleKey: function(e) { - if (this.shouldSupressKeyboardShortcut(e)) { return; } + if (this.shouldSuppressKeyboardShortcut(e)) { return; } switch (e.keyCode) { case 37: // left if (e.shiftKey && this._showInlineDiffs) {