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

This commit is contained in:
Barış Soner Uşaklı
2021-01-18 14:52:52 -05:00
parent e118e59ce0
commit 0fa4c11ea6

View File

@@ -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);
}