Skip to content

Commit 6b48b33

Browse files
committedJun 12, 2020
Fix timer type error with window.setTimeout
1 parent ffc25ad commit 6b48b33

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed
 

‎src/utils.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ export function throttle (callback: Function, delay: number) {
3737
if (last && now < last + delay) {
3838
// le délai n'est pas écoulé on reset le timer
3939
clearTimeout(timer);
40-
timer = setTimeout(function () {
40+
timer = window.setTimeout(function () {
4141
last = now;
4242
callback.apply(context, args);
4343
}, delay);
@@ -121,4 +121,4 @@ export function getOffset (element: HTMLElement) {
121121
left: (deltaLeft < 0) ? offset.left + Math.abs(deltaLeft) : offset.left - Math.abs(deltaLeft),
122122
top: (deltaTop < 0) ? offset.top + Math.abs(deltaTop) : offset.top - Math.abs(deltaTop)
123123
};
124-
}
124+
}

0 commit comments

Comments
 (0)
Failed to load comments.