From cc6113243adfbed92a1e1c81072d390377039b20 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 --- framework/core/js/forum/src/components/post-stream.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/framework/core/js/forum/src/components/post-stream.js b/framework/core/js/forum/src/components/post-stream.js index 35dd23f1d..d92229710 100644 --- a/framework/core/js/forum/src/components/post-stream.js +++ b/framework/core/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();