diff options
| author | Michael Save <savetheinternet@tinyboard.org> | 2012-03-15 16:42:58 +1100 |
|---|---|---|
| committer | Michael Save <savetheinternet@tinyboard.org> | 2012-03-15 16:42:58 +1100 |
| commit | a3b3e1cc64ff79dc670e84e7843e99ad83a61676 (patch) | |
| tree | 6748b8e0002af44f26cb50fa242b897669f67f9c /js | |
| parent | 34301da174acd3cfb326f03693657aeacd58be27 (diff) | |
Don't check for new posts unless user is scrolled past the most recent one.
Diffstat (limited to 'js')
| -rw-r--r-- | js/auto-reload.js | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/js/auto-reload.js b/js/auto-reload.js index 70b4acc3..83e9751e 100644 --- a/js/auto-reload.js +++ b/js/auto-reload.js @@ -18,6 +18,9 @@ $(document).ready(function(){ return; // not index 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({ url: document.location, success: function(data) { @@ -29,6 +32,6 @@ $(document).ready(function(){ }); } }); - }, 6000); + }, 5000); }); |
