fixed unworking infinite scroll
This commit is contained in:
parent
48bc4fc214
commit
ece9f50fb1
11 changed files with 180 additions and 66 deletions
|
@ -2,6 +2,7 @@ var CommitsList = {
|
|||
ref:null,
|
||||
limit:0,
|
||||
offset:0,
|
||||
disable:false,
|
||||
|
||||
init:
|
||||
function(ref, limit) {
|
||||
|
@ -36,15 +37,21 @@ var CommitsList = {
|
|||
$("#commits_list").append(html);
|
||||
if(count > 0) {
|
||||
this.offset += count;
|
||||
this.initLoadMore();
|
||||
} else {
|
||||
this.disable = true;
|
||||
}
|
||||
},
|
||||
|
||||
initLoadMore:
|
||||
function() {
|
||||
$(window).bind('scroll', function(){
|
||||
if($(window).scrollTop() == $(document).height() - $(window).height()){
|
||||
$(window).unbind('scroll');
|
||||
$(document).endlessScroll({
|
||||
bottomPixels: 400,
|
||||
fireDelay: 1000,
|
||||
fireOnce:true,
|
||||
ceaseFire: function() {
|
||||
return CommitsList.disable;
|
||||
},
|
||||
callback: function(i) {
|
||||
CommitsList.getOld();
|
||||
}
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue