Skip to content

Commit

Permalink
Ensure items in timeline view are visible (#200)
Browse files Browse the repository at this point in the history
  • Loading branch information
fredden authored Oct 17, 2023
1 parent 0556da1 commit d5a5c94
Showing 1 changed file with 9 additions and 15 deletions.
24 changes: 9 additions & 15 deletions view/adminhtml/web/js/lib/knockout/bindings/virtual-foreach.js
Original file line number Diff line number Diff line change
Expand Up @@ -202,25 +202,19 @@ define([
}
};

var windowTimer = null;
$(window).on('scroll', function() {
if (windowTimer !== null) {
clearTimeout(windowTimer);
var debounceRefresh = function() {
if (debounceRefresh.timer) {
clearTimeout(debounceRefresh.timer);
}
windowTimer = setTimeout(function() {

debounceRefresh.timer = setTimeout(function() {
raf(refresh);
}, 150);
});
};

var panelTimer = null;
$timelinePanel.on('scroll', function() {
if (panelTimer !== null) {
clearTimeout(panelTimer);
}
panelTimer = setTimeout(function() {
raf(refresh);
}, 1000);
});
$(window).on('scroll', debounceRefresh);
$timelinePanel.on('scroll', debounceRefresh);
$timelineCont.on('scroll', debounceRefresh);

$timelineCont.on('timeline.ready', function() {
$(window).trigger('scroll');
Expand Down

0 comments on commit d5a5c94

Please sign in to comment.