Skip to content

Commit c5eeabb

Browse files
committed
Pass arguments to debounce function correctly
1 parent c9d355f commit c5eeabb

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

js/resizeIframe.js

+3-1
Original file line numberDiff line numberDiff line change
@@ -53,9 +53,11 @@ export function createResizeIframe(site, frameId, debounceTime) {
5353
export function debounce(func, wait) {
5454
var timeout = 0;
5555
return function () {
56+
var context = this;
57+
var args = arguments;
5658
clearTimeout(timeout);
5759
timeout = setTimeout(function () {
58-
func.apply(null, arguments);
60+
func.apply(context, args);
5961
}, wait);
6062
};
6163
}

0 commit comments

Comments
 (0)