on master help sign in
Merge pull request #1226 from rndevfx/fix-vim-mode-on-firefox

Fix Vim mode on Firefox

commitb918b29f90ef874381987c2209a4615745286524 authorAdam Tauber <asciimoo@gmail.com> dateWed 7 Mar 2018, 10:46 (9 years ago) parent114d4430314349
1 file changed+2−1
searx/static/plugins/js/vim_hotkeys.js+2−1
searx/static/plugins/js/vim_hotkeys.js+2−1
@@ -104,7 +104,7 @@ $(document).ready(function() {
104104 }
105105 };
106106
107− $(document).keyup(function(e) {
107+ $(document).keydown(function(e) {
108108 // check for modifiers so we don't break browser's hotkeys
109109 if (vimKeys.hasOwnProperty(e.keyCode)
110110 && !e.ctrlKey
@@ -118,6 +118,7 @@ $(document).ready(function() {
118118 }
119119 } else {
120120 if (e.target === document.body) {
121+ e.preventDefault();
121122 vimKeys[e.keyCode].fun();
122123 }
123124 }