on master help sign in
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.

commit06979fa0829697ed3b0b1946a2ef7b43f308e2c4 authorNick Espig <nickespig@gmail.com> dateTue 4 Jun 2019, 18:22 (7 years ago) parent8189b0d
1 file changed+1−1
searx/static/plugins/js/infinite_scroll.js+1−1
searx/static/plugins/js/infinite_scroll.js+1−1
@@ -1,7 +1,7 @@
11$(document).ready(function() {
22 var win = $(window);
33 win.scroll(function() {
4− if ($(document).height() - win.height() == win.scrollTop()) {
4+ if ($(document).height() - win.height() - win.scrollTop() < 150) {
55 var formData = $('#pagination form:last').serialize();
66 if (formData) {
77 $('#pagination').html('<div class="loading-spinner"></div>');