only use more button have inf scroll happens 3 times
This commit is contained in:
parent
1fbcb3c3e5
commit
22c1743886
1 changed files with 17 additions and 7 deletions
|
|
@ -1,4 +1,6 @@
|
|||
$(document).ready(function() {
|
||||
var scrolled = 0;
|
||||
|
||||
$('#main_stream').infinitescroll({
|
||||
navSelector : ".pagination",
|
||||
// selector for the paged navigation (it will be hidden)
|
||||
|
|
@ -12,19 +14,27 @@ $(document).ready(function() {
|
|||
loadingText: "",
|
||||
loadingImg: '/images/ajax-loader.gif'
|
||||
}, function() {
|
||||
scrolled++;
|
||||
|
||||
if(scrolled > 2) {
|
||||
(scrolled === 3) && $(window).unbind('.infscr');
|
||||
|
||||
$("a.paginate")
|
||||
.detach()
|
||||
.appendTo("#main_stream")
|
||||
.css("display", "block");
|
||||
|
||||
Diaspora.widgets.timeago.updateTimeAgo();
|
||||
}
|
||||
});
|
||||
|
||||
$(window).unbind('.infscr');
|
||||
|
||||
|
||||
$("a.paginate").live("click", function() {
|
||||
$(this).css("display", "none");
|
||||
|
||||
$(document).trigger("retrieve.infscr");
|
||||
});
|
||||
})
|
||||
.css("display", "none");
|
||||
});
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue