mirror of
https://github.com/rr-/szurubooru.git
synced 2025-07-17 08:26:24 +00:00
Fixed endless scroll loading next page too eagerly
This commit is contained in:
@ -148,15 +148,16 @@ App.Presenters.PagedCollectionPresenter = function(
|
||||
if (!endlessScroll) {
|
||||
return;
|
||||
}
|
||||
var $scroller = jQuery('<div/>');
|
||||
|
||||
window.clearInterval(scrollInterval);
|
||||
scrollInterval = window.setInterval(function() {
|
||||
if ($scroller.is(':visible')) {
|
||||
var baseLine = $target.offset().top + $target.innerHeight();
|
||||
var scrollY = jQuery(window).scrollTop() + jQuery(window).height();
|
||||
if (scrollY > baseLine) {
|
||||
nextPageInplace();
|
||||
window.clearInterval(scrollInterval);
|
||||
}
|
||||
}, 50);
|
||||
$target.append($scroller);
|
||||
}, 100);
|
||||
}
|
||||
|
||||
function refreshPageList() {
|
||||
|
Reference in New Issue
Block a user