1
0
mirror of https://github.com/flarum/core.git synced 2025-07-12 04:16:24 +02:00

Optimize ScrollListener performance

Listen to "scroll" event and throttle callback executions instead
of actively polling for changes to the scroll position.

Fixes #1222.
This commit is contained in:
Franz Liedke
2019-09-05 02:17:09 +02:00
parent ed51f9ff0a
commit 0191babb05
3 changed files with 24 additions and 22 deletions

View File

@ -2,7 +2,6 @@ import Component from '../../common/Component';
import ScrollListener from '../../common/utils/ScrollListener';
import PostLoading from './LoadingPost';
import anchorScroll from '../../common/utils/anchorScroll';
import mixin from '../../common/utils/mixin';
import evented from '../../common/utils/evented';
import ReplyPlaceholder from './ReplyPlaceholder';
import Button from '../../common/components/Button';
@ -586,7 +585,7 @@ class PostStream extends Component {
*/
unpause() {
this.paused = false;
this.scrollListener.update(true);
this.scrollListener.update();
this.trigger('unpaused');
}
}