diff options
author | Richard Nespithal <richard@nespithal.com> | 2018-03-05 13:41:37 +0100 |
---|---|---|
committer | Richard Nespithal <richard@nespithal.com> | 2018-03-05 13:41:37 +0100 |
commit | 0314349b086b37d83f74993a94110ca38d36f18d (patch) | |
tree | 37151f78cfae34aaa3220d8c75d223efc2f5472c /searx/static/plugins | |
parent | 9fea2060b53cea72d57c92fef66a591ec867aee8 (diff) | |
download | searxng-0314349b086b37d83f74993a94110ca38d36f18d.tar.gz searxng-0314349b086b37d83f74993a94110ca38d36f18d.zip |
Fix Vim mode on Firefox
Firefox automatically opens a built-in quick search when user
starts typing without selected input and the Vim shortcuts
are not triggered
Diffstat (limited to 'searx/static/plugins')
-rw-r--r-- | searx/static/plugins/js/vim_hotkeys.js | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/searx/static/plugins/js/vim_hotkeys.js b/searx/static/plugins/js/vim_hotkeys.js index 61500d8f5..13bd070e0 100644 --- a/searx/static/plugins/js/vim_hotkeys.js +++ b/searx/static/plugins/js/vim_hotkeys.js @@ -104,7 +104,7 @@ $(document).ready(function() { } }; - $(document).keyup(function(e) { + $(document).keydown(function(e) { // check for modifiers so we don't break browser's hotkeys if (vimKeys.hasOwnProperty(e.keyCode) && !e.ctrlKey @@ -118,6 +118,7 @@ $(document).ready(function() { } } else { if (e.target === document.body) { + e.preventDefault(); vimKeys[e.keyCode].fun(); } } |