From 525e2b1b3f4a8e768f1f3b13104acf03af260941 Mon Sep 17 00:00:00 2001 From: Toby Zerner Date: Thu, 11 Jun 2015 18:40:21 +0930 Subject: [PATCH] Don't anchor scroll when the top of the page has been reached --- js/forum/src/components/post-stream.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/js/forum/src/components/post-stream.js b/js/forum/src/components/post-stream.js index 35dd23f1d..d92229710 100644 --- a/js/forum/src/components/post-stream.js +++ b/js/forum/src/components/post-stream.js @@ -295,7 +295,7 @@ class PostStream extends mixin(Component, evented) { var redraw = () => { if (start < this.visibleStart || end > this.visibleEnd) return; - var anchorIndex = backwards ? this.visibleEnd - 1 : this.visibleStart; + var anchorIndex = backwards && $(window).scrollTop() > 0 ? this.visibleEnd - 1 : this.visibleStart; anchorScroll(this.$('.item[data-index='+anchorIndex+']'), () => m.redraw(true)); this.unpause();