on master help sign in
Fix result selection for top & bottom scrolling
c12e41aKirill Isakov
searx/static/plugins/js/vim_hotkeys.js+4−4
@@ -44,13 +44,13 @@ $(document).ready(function() {
44 },
44 },
45 71: {
45 71: {
46 key: 'g',
46 key: 'g',
47− fun: scrollPageTo(-document.body.scrollHeight),
47+ fun: scrollPageTo(-document.body.scrollHeight, 'top'),
48 des: 'scroll to the top of the page',
48 des: 'scroll to the top of the page',
49 cat: 'Navigation'
49 cat: 'Navigation'
50 },
50 },
51 86: {
51 86: {
52 key: 'v',
52 key: 'v',
53− fun: scrollPageTo(document.body.scrollHeight),
53+ fun: scrollPageTo(document.body.scrollHeight, 'bottom'),
54 des: 'scroll to the bottom of the page',
54 des: 'scroll to the bottom of the page',
55 cat: 'Navigation'
55 cat: 'Navigation'
56 },
56 },
@@ -241,10 +241,10 @@ $(document).ready(function() {
241 }
241 }
242 }
242 }
243
243
244− function scrollPageTo(position) {
244+ function scrollPageTo(position, nav) {
245 return function() {
245 return function() {
246 window.scrollTo(0, position);
246 window.scrollTo(0, position);
247− highlightResult('visible')();
247+ highlightResult(nav)();
248 }
248 }
249 }
249 }
250
250