summaryrefslogtreecommitdiff
path: root/searx/static/plugins
diff options
context:
space:
mode:
authorMathieu Brunot <mathieu.brunot@monogramm.io>2019-12-24 21:38:07 +0100
committerGitHub <noreply@github.com>2019-12-24 21:38:07 +0100
commit359c18f9e633fe4cf1062bb2e7507840065e6ca5 (patch)
treea0babfcc9471b69a20358fa95f47e22b469af7f0 /searx/static/plugins
parent088752959e5cb635b55cb74e8d9d90e5062e0a7f (diff)
parenta52a638ba88466c587fd8afa744434711b1e4822 (diff)
Merge branch 'master' into docker/opencontainers
Diffstat (limited to 'searx/static/plugins')
-rw-r--r--searx/static/plugins/js/vim_hotkeys.js12
1 files changed, 10 insertions, 2 deletions
diff --git a/searx/static/plugins/js/vim_hotkeys.js b/searx/static/plugins/js/vim_hotkeys.js
index 13bd070e0..b0f265cb5 100644
--- a/searx/static/plugins/js/vim_hotkeys.js
+++ b/searx/static/plugins/js/vim_hotkeys.js
@@ -125,6 +125,14 @@ $(document).ready(function() {
}
});
+ function nextResult(current, direction) {
+ var next = current[direction]();
+ while (!next.is('.result') && next.length !== 0) {
+ next = next[direction]();
+ }
+ return next
+ }
+
function highlightResult(which) {
return function() {
var current = $('.result[data-vim-selected]');
@@ -157,13 +165,13 @@ $(document).ready(function() {
}
break;
case 'down':
- next = current.next('.result');
+ next = nextResult(current, 'next');
if (next.length === 0) {
next = $('.result:first');
}
break;
case 'up':
- next = current.prev('.result');
+ next = nextResult(current, 'prev');
if (next.length === 0) {
next = $('.result:last');
}