mirror of
https://github.com/flarum/framework.git
synced 2025-01-19 18:12:59 +08:00
Don't anchor scroll when the top of the page has been reached
This commit is contained in:
parent
914528d6c4
commit
cc6113243a
|
@ -295,7 +295,7 @@ class PostStream extends mixin(Component, evented) {
|
||||||
var redraw = () => {
|
var redraw = () => {
|
||||||
if (start < this.visibleStart || end > this.visibleEnd) return;
|
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));
|
anchorScroll(this.$('.item[data-index='+anchorIndex+']'), () => m.redraw(true));
|
||||||
|
|
||||||
this.unpause();
|
this.unpause();
|
||||||
|
|
Loading…
Reference in New Issue
Block a user