Don't check for new posts unless user is scrolled past the most recent one.
This commit is contained in:
parent
34301da174
commit
a3b3e1cc64
@ -18,6 +18,9 @@ $(document).ready(function(){
|
|||||||
return; // not index
|
return; // not index
|
||||||
|
|
||||||
setInterval(function() {
|
setInterval(function() {
|
||||||
|
if($(window).scrollTop() + $(window).height() < $('div.post.reply:last').position().top + $('div.post.reply:last').height())
|
||||||
|
return; // not scrolled past last reply
|
||||||
|
|
||||||
$.ajax({
|
$.ajax({
|
||||||
url: document.location,
|
url: document.location,
|
||||||
success: function(data) {
|
success: function(data) {
|
||||||
@ -29,6 +32,6 @@ $(document).ready(function(){
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}, 6000);
|
}, 5000);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user