some pagination work

This commit is contained in:
Baris Soner Usakli
2014-01-24 13:27:36 -05:00
parent 620ff65cbe
commit cf39c66017
5 changed files with 62 additions and 17 deletions

View File

@@ -355,15 +355,27 @@ define(['composer'], function(composer) {
});
function enableInfiniteLoading() {
$(window).off('scroll').on('scroll', function() {
var bottom = ($(document).height() - $(window).height()) * 0.9;
if(!config.usePagination) {
$(window).off('scroll').on('scroll', function() {
var bottom = ($(document).height() - $(window).height()) * 0.9;
if ($(window).scrollTop() > bottom && !infiniteLoaderActive && $('#post-container').children().length) {
loadMorePosts(tid, function(posts) {
fixDeleteStateForPosts();
});
}
});
if ($(window).scrollTop() > bottom && !infiniteLoaderActive && $('#post-container').children().length) {
loadMorePosts(tid, function(posts) {
fixDeleteStateForPosts();
});
}
});
} else {
$('.pagination .previous').on('click', function() {
return false;
});
$('.pagination .next').on('click', function() {
return false;
});
}
}
$('.topic').on('click', '.post_reply', function() {