diff --git a/slick.core.js b/slick.core.js index 1f5094bd..96791e66 100644 --- a/slick.core.js +++ b/slick.core.js @@ -567,23 +567,6 @@ return elm; } - /** - * Debounce to delay JS callback execution, a wait of (-1) could be provided to execute callback without delay. - * @param {Function} callback - callback method to execute - * @param {Number} wait - delay to wait before execution or -1 delay - */ - function debounce(callback, wait) { - let timeoutId = null; - return (...args) => { - if (wait >= 0) { - clearTimeout(timeoutId); - timeoutId = setTimeout(() => callback.apply(null, args), wait); - } else { - callback.apply(null); - } - }; - } - function emptyElement(element) { if (element && element.firstChild) { while (element.firstChild) { @@ -889,7 +872,6 @@ "EditorLock": EditorLock, "BindingEventService": BindingEventService, "Utils": { - "debounce": debounce, "extend": extend, "calculateAvailableSpace": calculateAvailableSpace, "createDomElement": createDomElement, diff --git a/slick.grid.js b/slick.grid.js index b2787c1d..ebc20d1a 100644 --- a/slick.grid.js +++ b/slick.grid.js @@ -108,7 +108,6 @@ if (typeof Slick === "undefined") { viewportMinWidthPx: undefined, viewportMaxWidthPx: undefined, suppressCssChangesOnHiddenInit: false, - scrollDebounceDelay: -1, // add a scroll delay to avoid screen flickering, -1 to disable delay ffMaxSupportedCssHeight: 6000000, maxSupportedCssHeight: 1000000000, sanitizer: undefined, // sanitize function, built in basic sanitizer is: Slick.RegexSanitizer(dirtyHtml) @@ -4356,34 +4355,31 @@ if (typeof Slick === "undefined") { prevScrollLeft = scrollLeft; // adjust scroll position of all div containers when scrolling the grid - // user can optionally provide "scrollDebounceDelay" grid option if flickering are a problem - utils.debounce(() => { - _viewportScrollContainerX.scrollLeft = scrollLeft; - _headerScrollContainer.scrollLeft = scrollLeft; - _topPanelScrollers[0].scrollLeft = scrollLeft; - if (options.createFooterRow) { - _footerRowScrollContainer.scrollLeft = scrollLeft; - } - if (options.createPreHeaderPanel) { - if (hasFrozenColumns()) { - _preHeaderPanelScrollerR.scrollLeft = scrollLeft; - } else { - _preHeaderPanelScroller.scrollLeft = scrollLeft; - } - } - + _viewportScrollContainerX.scrollLeft = scrollLeft; + _headerScrollContainer.scrollLeft = scrollLeft; + _topPanelScrollers[0].scrollLeft = scrollLeft; + if (options.createFooterRow) { + _footerRowScrollContainer.scrollLeft = scrollLeft; + } + if (options.createPreHeaderPanel) { if (hasFrozenColumns()) { - if (hasFrozenRows) { - _viewportTopR.scrollLeft = scrollLeft; - } - _headerRowScrollerR.scrollLeft = scrollLeft; // right header row scrolling with frozen grid + _preHeaderPanelScrollerR.scrollLeft = scrollLeft; } else { - if (hasFrozenRows) { - _viewportTopL.scrollLeft = scrollLeft; - } - _headerRowScrollerL.scrollLeft = scrollLeft; // left header row scrolling with regular grid + _preHeaderPanelScroller.scrollLeft = scrollLeft; } - }, options.scrollDebounceDelay)(); + } + + if (hasFrozenColumns()) { + if (hasFrozenRows) { + _viewportTopR.scrollLeft = scrollLeft; + } + _headerRowScrollerR.scrollLeft = scrollLeft; // right header row scrolling with frozen grid + } else { + if (hasFrozenRows) { + _viewportTopL.scrollLeft = scrollLeft; + } + _headerRowScrollerL.scrollLeft = scrollLeft; // left header row scrolling with regular grid + } } // autoheight suppresses vertical scrolling, but editors can create a div larger than