Fixed endless scroll loading next page too eagerly
This commit is contained in:
parent
2c358b3c77
commit
9699aeaf64
1 changed files with 5 additions and 4 deletions
|
@ -148,15 +148,16 @@ App.Presenters.PagedCollectionPresenter = function(
|
||||||
if (!endlessScroll) {
|
if (!endlessScroll) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
var $scroller = jQuery('<div/>');
|
|
||||||
window.clearInterval(scrollInterval);
|
window.clearInterval(scrollInterval);
|
||||||
scrollInterval = window.setInterval(function() {
|
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();
|
nextPageInplace();
|
||||||
window.clearInterval(scrollInterval);
|
window.clearInterval(scrollInterval);
|
||||||
}
|
}
|
||||||
}, 50);
|
}, 100);
|
||||||
$target.append($scroller);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function refreshPageList() {
|
function refreshPageList() {
|
||||||
|
|
Loading…
Reference in a new issue