possibly fix skipped pages on endless scroll
This commit is contained in:
parent
c7ac5a9d80
commit
9b67e114ad
@ -118,6 +118,7 @@
|
|||||||
var scroll_next = false;
|
var scroll_next = false;
|
||||||
var next_page = 1;
|
var next_page = 1;
|
||||||
var page_load = true;
|
var page_load = true;
|
||||||
|
var loadingPage = false;
|
||||||
|
|
||||||
$(function() {
|
$(function() {
|
||||||
$.ajaxSetup({cache: false});
|
$.ajaxSetup({cache: false});
|
||||||
@ -395,6 +396,10 @@ function updateConvItems(mode,data) {
|
|||||||
// $("div.wall-item-body").divgrow({ initialHeight: 400 });
|
// $("div.wall-item-body").divgrow({ initialHeight: 400 });
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
if(loadingPage) {
|
||||||
|
loadingPage = false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if(mode === 'replace') {
|
if(mode === 'replace') {
|
||||||
// clear existing content
|
// clear existing content
|
||||||
@ -916,6 +921,7 @@ $(".autotime").timeago();
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
$(window).scroll(function () {
|
$(window).scroll(function () {
|
||||||
if(typeof buildCmd == 'function') {
|
if(typeof buildCmd == 'function') {
|
||||||
$('#more').hide();
|
$('#more').hide();
|
||||||
@ -927,12 +933,15 @@ $(window).scroll(function () {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if($(window).scrollTop() + $(window).height() == $(document).height()) {
|
if($(window).scrollTop() + $(window).height() == $(document).height()) {
|
||||||
|
if(! loadingPage) {
|
||||||
$('#more').hide();
|
$('#more').hide();
|
||||||
$('#no-more').hide();
|
$('#no-more').hide();
|
||||||
// alert('scroll');
|
// alert('scroll');
|
||||||
next_page++;
|
next_page++;
|
||||||
scroll_next = true;
|
scroll_next = true;
|
||||||
|
loadingPage = true;
|
||||||
liveUpdate();
|
liveUpdate();
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user