From 06cd4cd4067226991b44ae60282f34c94376ced1 Mon Sep 17 00:00:00 2001 From: Julian Lam Date: Fri, 1 Apr 2016 15:37:01 -0400 Subject: [PATCH] only triggering topic infinite loader once a second, fixes #4477 --- public/src/client/topic/posts.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/public/src/client/topic/posts.js b/public/src/client/topic/posts.js index 5c326532ab..696b2f51ec 100644 --- a/public/src/client/topic/posts.js +++ b/public/src/client/topic/posts.js @@ -181,10 +181,13 @@ define('forum/topic/posts', [ } Posts.loadMorePosts = function(direction) { - if (!components.get('topic').length || navigator.scrollActive) { + if (!components.get('topic').length || navigator.scrollActive || Posts._infiniteScrollTimeout) { return; } + Posts._infiniteScrollTimeout = setTimeout(function() { + delete Posts._infiniteScrollTimeout; + }, 1000); var replies = components.get('post').not('[data-index=0]').not('.new'); var afterEl = direction > 0 ? replies.last() : replies.first(); var after = parseInt(afterEl.attr('data-index'), 10) || 0; @@ -204,7 +207,6 @@ define('forum/topic/posts', [ after: after, direction: direction }, function (data, done) { - indicatorEl.fadeOut(); if (data && data.posts && data.posts.length) {