瀏覽代碼

Fix result selection for top & bottom scrolling

Kirill Isakov 9 年之前
父節點
當前提交
c12e41a80f
共有 1 個檔案被更改,包括 4 行新增4 行删除
  1. 4
    4
      searx/static/plugins/js/vim_hotkeys.js

+ 4
- 4
searx/static/plugins/js/vim_hotkeys.js 查看文件

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
         }
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