diff options
author | Nick Espig <nickespig@gmail.com> | 2019-06-04 18:22:02 +0200 |
---|---|---|
committer | Nick Espig <nickespig@gmail.com> | 2019-06-04 18:22:02 +0200 |
commit | 06979fa0829697ed3b0b1946a2ef7b43f308e2c4 (patch) | |
tree | 2caded25c96f1b122a889606c9d3c6e53fe2f5fc /searx/static | |
parent | 8189b0d192224abe9e8ce61747328ebdc34fabb1 (diff) | |
download | searxng-06979fa0829697ed3b0b1946a2ef7b43f308e2c4.tar.gz searxng-06979fa0829697ed3b0b1946a2ef7b43f308e2c4.zip |
Load next page shortly before hitting the bottom
This improves the user experience by loading in the next entries shortly before him getting to the bottom. It makes the scrolling more smooth without a break in between.
It also fixes an error on my browser that scrolling never hits the defined number. When I debugged it I hit `.scrolltop` of 1092.5 and the `doc.height - win.height` of 1093, so the condition was never true.
Diffstat (limited to 'searx/static')
-rw-r--r-- | searx/static/plugins/js/infinite_scroll.js | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/searx/static/plugins/js/infinite_scroll.js b/searx/static/plugins/js/infinite_scroll.js index 9cd582d7f..1a95756a0 100644 --- a/searx/static/plugins/js/infinite_scroll.js +++ b/searx/static/plugins/js/infinite_scroll.js @@ -1,7 +1,7 @@ $(document).ready(function() { var win = $(window); win.scroll(function() { - if ($(document).height() - win.height() == win.scrollTop()) { + if ($(document).height() - win.height() - win.scrollTop() < 150) { var formData = $('#pagination form:last').serialize(); if (formData) { $('#pagination').html('<div class="loading-spinner"></div>'); |