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() {
|
$(document).ready(function() {
|
||||||
|
var scrolled = 0;
|
||||||
|
|
||||||
$('#main_stream').infinitescroll({
|
$('#main_stream').infinitescroll({
|
||||||
navSelector : ".pagination",
|
navSelector : ".pagination",
|
||||||
// selector for the paged navigation (it will be hidden)
|
// selector for the paged navigation (it will be hidden)
|
||||||
|
|
@ -12,19 +14,27 @@ $(document).ready(function() {
|
||||||
loadingText: "",
|
loadingText: "",
|
||||||
loadingImg: '/images/ajax-loader.gif'
|
loadingImg: '/images/ajax-loader.gif'
|
||||||
}, function() {
|
}, function() {
|
||||||
$("a.paginate")
|
scrolled++;
|
||||||
.detach()
|
|
||||||
.appendTo("#main_stream")
|
if(scrolled > 2) {
|
||||||
.css("display", "block");
|
(scrolled === 3) && $(window).unbind('.infscr');
|
||||||
Diaspora.widgets.timeago.updateTimeAgo();
|
|
||||||
|
$("a.paginate")
|
||||||
|
.detach()
|
||||||
|
.appendTo("#main_stream")
|
||||||
|
.css("display", "block");
|
||||||
|
|
||||||
|
Diaspora.widgets.timeago.updateTimeAgo();
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
$(window).unbind('.infscr');
|
|
||||||
|
|
||||||
$("a.paginate").live("click", function() {
|
$("a.paginate").live("click", function() {
|
||||||
$(this).css("display", "none");
|
$(this).css("display", "none");
|
||||||
|
|
||||||
$(document).trigger("retrieve.infscr");
|
$(document).trigger("retrieve.infscr");
|
||||||
});
|
})
|
||||||
|
.css("display", "none");
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue