Skip to content

Node.js based forum software built for the modern web

fix: don't chagne scrollTop if at the top of page

Barış Soner Uşaklı0fa4c11ea6fd
diff --git a/public/src/client/topic/posts.js b/public/src/client/topic/posts.js
index 8e14941524..e0dd634049 100644
--- a/public/src/client/topic/posts.js
+++ b/public/src/client/topic/posts.js
@@ -210,7 +210,9 @@ define('forum/topic/posts', [
html.insertBefore(before);
// Now restore the relative position the user was on prior to new post insertion
- $(window).scrollTop(scrollTop + ($(document).height() - height));
+ if (scrollTop > 0) {
+ $(window).scrollTop(scrollTop + ($(document).height() - height));
+ }
} else {
components.get('topic').append(html);
}