Skip to content

Commit 8454ee9

Browse files
committed
perf: update scrollable toolbars in task #15091
Fixes #15091 - very frequent task - happens on resize of window, scroll of document, status of commands - example is scrolling between Writer pages when we need to update page number in statusbar - causing it to happen synchronously and reducing frame rate on that fragments Signed-off-by: Szymon Kłos <szymon.klos@collabora.com> Change-Id: I46e8426c7417bb4c33c45e1967f60114900ef835
1 parent 9ee4579 commit 8454ee9

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

browser/src/control/jsdialog/Util.ScrollableBar.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ function setupResizeHandler(container: Element, scrollable: Element) {
5252
var isRTL: boolean = document.documentElement.dir === 'rtl';
5353
var timer: any; // for shift + mouse wheel up/down
5454

55-
const handler = function () {
55+
const handlerImpl = () => {
5656
const rootContainer = scrollable.querySelector('div');
5757
if (!rootContainer) return;
5858

@@ -77,7 +77,11 @@ function setupResizeHandler(container: Element, scrollable: Element) {
7777
showArrow(left, false);
7878
showArrow(right, false);
7979
}
80-
}.bind(this);
80+
};
81+
82+
const handler = () => {
83+
app.layoutingService.appendLayoutingTask(handlerImpl);
84+
};
8185

8286
// handler for toolbar and statusbar
8387
// runs if shift + mouse wheel up/down are used

0 commit comments

Comments
 (0)