Skip to content

Commit

Permalink
#43 Remove debounce
Browse files Browse the repository at this point in the history
  • Loading branch information
tdziezykDS committed Nov 17, 2023
1 parent af7f996 commit 45cc155
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions blocks/v2-truck-features/v2-truck-features.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import {
createElement, debounce, unwrapDivs, variantsClassesToBEM,
createElement, unwrapDivs, variantsClassesToBEM,
} from '../../scripts/common.js';
import { getAllElWithChildren } from '../../scripts/scripts.js';

Expand Down Expand Up @@ -151,7 +151,7 @@ export default async function decorate(block) {

let slideIndex = 0;

window.addEventListener('scroll', debounce(() => {
window.addEventListener('scroll', () => {
const navHeight = getComputedStyle(document.documentElement).getPropertyValue('--nav-height');
const navHeightInPx = Number.parseInt(navHeight, 10); // assuming that the --nav-height is in px
const inPageNav = getComputedStyle(document.documentElement).getPropertyValue('--inpage-navigation-height');
Expand Down Expand Up @@ -180,5 +180,5 @@ export default async function decorate(block) {

slideIndex = newSlideIndex;
}
}, 10));
});
}

0 comments on commit 45cc155

Please sign in to comment.