Skip to content

Commit

Permalink
Revert "jsdialog: send less messages for scrolled window"
Browse files Browse the repository at this point in the history
This reverts commit fd35bd7.
Related to issues #9614 #9559 #9770

Signed-off-by: Szymon Kłos <[email protected]>
Change-Id: If703d2c20ceee4321520aa01a5b55c95e3c27113
  • Loading branch information
eszkadev authored and timar committed Aug 29, 2024
1 parent 2b00482 commit 0bcebdf
Showing 1 changed file with 2 additions and 14 deletions.
16 changes: 2 additions & 14 deletions browser/src/control/jsdialog/Widget.ScrolledWindow.js
Original file line number Diff line number Diff line change
Expand Up @@ -142,8 +142,6 @@ function _scrolledWindowControl(parentContainer, data, builder) {
resizeObserver.observe(content);
}

var lastScrollV = null;
var lastScrollH = null;
var sendTimer = null;
if ((!noVertical && verticalSteps) || (!noHorizontal && horizontalSteps)) {
scrollwindow.addEventListener('scroll', function() {
Expand All @@ -161,18 +159,8 @@ function _scrolledWindowControl(parentContainer, data, builder) {
if (sendTimer)
clearTimeout(sendTimer);
sendTimer = setTimeout(function () {
var newScrollV = Math.round(scrollwindow.scrollTop / rowHeight);
if (lastScrollV !== newScrollV) {
lastScrollV = newScrollV;
builder.callback('scrolledwindow', 'scrollv', scrollwindow, newScrollV, builder);
}

var newScrollH = Math.round(scrollwindow.scrollLeft / 10);
if (lastScrollH !== newScrollH) {
lastScrollH = newScrollH;
builder.callback('scrolledwindow', 'scrollh', scrollwindow, newScrollH, builder);
}
}, 50);
builder.callback('scrolledwindow', 'scrollv', scrollwindow, Math.round(scrollwindow.scrollTop / rowHeight), builder);
builder.callback('scrolledwindow', 'scrollh', scrollwindow, Math.round(scrollwindow.scrollLeft / 10), builder); }, 50);
});
}

Expand Down

0 comments on commit 0bcebdf

Please sign in to comment.