Skip to content

Node.js based forum software built for the modern web

fix first reply insertion

barisusaklic3a6b1193963
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;