From c3a6b11939635897e13a3db21ff05c8c2fb58c4c Mon Sep 17 00:00:00 2001 From: barisusakli Date: Fri, 25 Sep 2015 17:44:45 -0400 Subject: [PATCH] fix first reply insertion --- public/src/client/topic/posts.js | 4 ++-- public/src/modules/navigator.js | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/public/src/client/topic/posts.js b/public/src/client/topic/posts.js index 523da2c793..b0161ac5e0 100644 --- a/public/src/client/topic/posts.js +++ b/public/src/client/topic/posts.js @@ -123,9 +123,9 @@ define('forum/topic/posts', [ var after, before; - if (direction === 1) { + if (direction === 1 && repliesSelector.length) { after = repliesSelector.last(); - } else if (direction === -1) { + } else if (direction === -1 && repliesSelector.length) { before = repliesSelector.first(); } diff --git a/public/src/modules/navigator.js b/public/src/modules/navigator.js index 69ecf8d185..5cc1092f37 100644 --- a/public/src/modules/navigator.js +++ b/public/src/modules/navigator.js @@ -197,7 +197,7 @@ define('navigator', ['forum/pagination', 'components'], function(pagination, com navigator.scrollToPostIndex = function(postIndex, highlight, duration, offset) { var scrollTo = components.get('post/anchor', postIndex); - + if (!scrollTo.length) { navigator.scrollActive = false; return;