summaryrefslogtreecommitdiff
path: root/searx/static/plugins
diff options
context:
space:
mode:
authorMarkus Heiser <markus.heiser@darmarIT.de>2020-01-28 10:59:03 +0000
committerGitHub <noreply@github.com>2020-01-28 10:59:03 +0000
commite64ff38217a1ba49afd4bb1c595121d94cbb2e33 (patch)
treed8461b0392143da9d8ec9ae598b8a12c50914104 /searx/static/plugins
parent0e7b6c9a032d67bf5cbdcfc062d8466c18a62abd (diff)
parentbda189565589b0065152f5a9fba4565404f9bd9a (diff)
downloadsearxng-e64ff38217a1ba49afd4bb1c595121d94cbb2e33.tar.gz
searxng-e64ff38217a1ba49afd4bb1c595121d94cbb2e33.zip
Merge branch 'master' into fix-infinite-scroll
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');
}