Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Calc toolbar/statusbar: fix scroll button issues on horizontal scroll #10944

Merged
merged 4 commits into from
Jan 28, 2025
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Calc: change shiftHandler to arrow function
to automatically bind 'this'.

Signed-off-by: Bayram Çiçek <bayram.cicek@collabora.com>
Change-Id: Ie80b750ade42c72285c116c0a0b75d6f9e0fa38c
bayramcicek committed Jan 28, 2025
commit 4607e2761f0431e2b2b04ccef64a69a46aa56033
8 changes: 3 additions & 5 deletions browser/src/control/jsdialog/Util.ScrollableBar.ts
Original file line number Diff line number Diff line change
@@ -80,7 +80,7 @@ function setupResizeHandler(container: Element, scrollable: Element) {

// handler for toolbar and statusbar
// runs if shift + mouse wheel up/down are used
const shiftHandler = function (e: MouseEvent) {
const shiftHandler = (e: MouseEvent) => {
const rootContainer = scrollable.querySelector('div');
if (!rootContainer || !e.shiftKey) return;

@@ -89,13 +89,11 @@ function setupResizeHandler(container: Element, scrollable: Element) {
timer = setTimeout(function () {
JSDialog.RefreshScrollables();
}, 350);
}.bind(this);
};

window.addEventListener('resize', handler);
window.addEventListener('scroll', handler);
document
.querySelector('.ui-scrollable-content')
.addEventListener('wheel', shiftHandler);
scrollable.addEventListener('wheel', shiftHandler);
}

JSDialog.MakeScrollable = function (parent: Element, scrollable: Element) {