1
0
mirror of https://github.com/flarum/core.git synced 2025-08-01 14:10:37 +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 icon from '../../common/helpers/icon';
import ScrollListener from '../../common/utils/ScrollListener';
import SubtreeRetainer from '../../common/utils/SubtreeRetainer';
import computed from '../../common/utils/computed';
import formatNumber from '../../common/utils/formatNumber';
/**
@@ -365,7 +364,7 @@ export default class PostStreamScrubber extends Component {
}
onresize() {
this.scrollListener.update(true);
this.scrollListener.update();
// Adjust the height of the scrollbar so that it fills the height of
// the sidebar and doesn't overlap the footer.