1
0
mirror of https://github.com/flarum/core.git synced 2025-10-25 05:36:07 +02:00

Merge pull request #2299 from flarum/as/poststream_improvements

[Frontend Rewrite] PostStream Improvements
This commit is contained in:
Alexander Skvortsov
2020-09-29 18:34:16 -04:00
committed by GitHub
4 changed files with 52 additions and 16 deletions

View File

@@ -37,6 +37,18 @@ class PostStreamState {
*/
this.description = '';
/**
* When the page is scrolled, goToIndex is called, or the page is loaded,
* various listeners result in the scrubber being updated with a new
* position and values. However, if goToNumber is called, the scrubber
* will not be updated. Accordingly, we add logic to the scrubber's
* onupdate to update itself, but only when needed, as indicated by this
* property.
*
* @type {Boolean}
*/
this.forceUpdateScrubber = false;
this.show(includedPosts);
}
@@ -92,7 +104,7 @@ class PostStreamState {
this.loadPromise = this.loadNearNumber(number);
this.targetPost = { number };
this.noAnimationScroll = noAnimation;
this.animateScroll = !noAnimation;
this.number = number;
// In this case, the redraw is only called after the response has been loaded
@@ -116,7 +128,7 @@ class PostStreamState {
this.loadPromise = this.loadNearIndex(index);
this.targetPost = { index };
this.noAnimationScroll = noAnimation;
this.animateScroll = !noAnimation;
this.index = index;
m.redraw();