Browse Source

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

Fix Vim mode on Firefox
Adam Tauber 6 years ago
parent
commit
b918b29f90
No account linked to committer's email
1 changed files with 2 additions and 1 deletions
  1. 2
    1
      searx/static/plugins/js/vim_hotkeys.js

+ 2
- 1
searx/static/plugins/js/vim_hotkeys.js View File

104
         }
104
         }
105
     };
105
     };
106
 
106
 
107
-    $(document).keyup(function(e) {
107
+    $(document).keydown(function(e) {
108
         // check for modifiers so we don't break browser's hotkeys
108
         // check for modifiers so we don't break browser's hotkeys
109
         if (vimKeys.hasOwnProperty(e.keyCode)
109
         if (vimKeys.hasOwnProperty(e.keyCode)
110
             && !e.ctrlKey
110
             && !e.ctrlKey
118
                 }
118
                 }
119
             } else {
119
             } else {
120
                 if (e.target === document.body) {
120
                 if (e.target === document.body) {
121
+                    e.preventDefault();
121
                     vimKeys[e.keyCode].fun();
122
                     vimKeys[e.keyCode].fun();
122
                 }
123
                 }
123
             }
124
             }