1
0
mirror of https://github.com/searxng/searxng.git synced 2024-10-02 17:40:18 +02:00

Merge pull request #1226 from rndevfx/fix-vim-mode-on-firefox

Fix Vim mode on Firefox
This commit is contained in:
Adam Tauber 2018-03-07 10:46:24 +01:00 committed by GitHub
commit b918b29f90
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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 // check for modifiers so we don't break browser's hotkeys
if (vimKeys.hasOwnProperty(e.keyCode) if (vimKeys.hasOwnProperty(e.keyCode)
&& !e.ctrlKey && !e.ctrlKey
@ -118,6 +118,7 @@ $(document).ready(function() {
} }
} else { } else {
if (e.target === document.body) { if (e.target === document.body) {
e.preventDefault();
vimKeys[e.keyCode].fun(); vimKeys[e.keyCode].fun();
} }
} }