1
0
mirror of https://github.com/flarum/core.git synced 2025-07-19 07:41:22 +02:00

Don't anchor scroll when the top of the page has been reached

This commit is contained in:
Toby Zerner
2015-06-11 18:40:21 +09:30
parent 070d8fb04d
commit 525e2b1b3f

View File

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