summaryrefslogtreecommitdiff
path: root/searx/static/plugins
diff options
context:
space:
mode:
authorMarkus Heiser <markus.heiser@darmarIT.de>2020-01-06 08:05:29 +0000
committerGitHub <noreply@github.com>2020-01-06 08:05:29 +0000
commit1d86d0054ff29344f93943896847c12f51e1a9e0 (patch)
tree83a1cd1d16a73f25160b7d260b38ab649236637d /searx/static/plugins
parent70f7142824cc44afddb5704fd59e3a4194f3dc0e (diff)
parent17b6faa4c3c1cf14a327f4a3538fc70dce08b756 (diff)
Merge branch 'master' into bug/oscar-theme
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');
}