aboutsummaryrefslogtreecommitdiff
path: root/ext/bg/js
diff options
context:
space:
mode:
Diffstat (limited to 'ext/bg/js')
-rw-r--r--ext/bg/js/options.js3
-rw-r--r--ext/bg/js/search.js21
2 files changed, 14 insertions, 10 deletions
diff --git a/ext/bg/js/options.js b/ext/bg/js/options.js
index cbc390da..964c346c 100644
--- a/ext/bg/js/options.js
+++ b/ext/bg/js/options.js
@@ -716,7 +716,8 @@ class OptionsUtil {
profile.options.general.popupActionBarLocation = 'top';
profile.options.inputs = {
hotkeys: [
- {action: 'close', key: 'Escape', modifiers: [], scopes: ['popup', 'search'], enabled: true},
+ {action: 'close', key: 'Escape', modifiers: [], scopes: ['popup'], enabled: true},
+ {action: 'focusSearchBox', key: 'Escape', modifiers: [], scopes: ['search'], enabled: true},
{action: 'previousEntry3', key: 'PageUp', modifiers: ['alt'], scopes: ['popup', 'search'], enabled: true},
{action: 'nextEntry3', key: 'PageDown', modifiers: ['alt'], scopes: ['popup', 'search'], enabled: true},
{action: 'lastEntry', key: 'End', modifiers: ['alt'], scopes: ['popup', 'search'], enabled: true},
diff --git a/ext/bg/js/search.js b/ext/bg/js/search.js
index 340b86ce..00148418 100644
--- a/ext/bg/js/search.js
+++ b/ext/bg/js/search.js
@@ -43,6 +43,10 @@ class DisplaySearch extends Display {
}
});
this.autoPlayAudioDelay = 0;
+
+ this.registerActions([
+ ['focusSearchBox', this._onActionFocusSearchBox.bind(this)]
+ ]);
}
async prepare() {
@@ -77,15 +81,6 @@ class DisplaySearch extends Display {
this._isPrepared = true;
}
- onEscape() {
- if (this._queryInput === null) {
- return;
- }
-
- this._queryInput.focus();
- this._queryInput.select();
- }
-
onKeyDown(e) {
if (
!super.onKeyDown(e) &&
@@ -110,6 +105,14 @@ class DisplaySearch extends Display {
return query;
}
+ // Actions
+
+ _onActionFocusSearchBox() {
+ if (this._queryInput === null) { return; }
+ this._queryInput.focus();
+ this._queryInput.select();
+ }
+
// Private
async _onOptionsUpdated() {