From 2528f138ca04e38008e6b40dbd11c53a240829a7 Mon Sep 17 00:00:00 2001 From: Aaron Triantafyllidis Date: Mon, 3 Nov 2014 12:16:58 -0500 Subject: [PATCH] Call apply correctly When an initCallback is provided the apply call is not sending an array parameter as expected. This commit ensures an array is provided when calling apply. --- src/e-smart-zoom-jquery.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/e-smart-zoom-jquery.js b/src/e-smart-zoom-jquery.js index 84231c6..dc180d2 100644 --- a/src/e-smart-zoom-jquery.js +++ b/src/e-smart-zoom-jquery.js @@ -145,7 +145,7 @@ $(window).bind('resize.smartZoom', windowResizeEventHandler); // call "adjustToContainer" on resize if(settings.initCallback != null) // call callback function after plugin initialization - settings.initCallback.apply(this, targetElement); + settings.initCallback.apply(this, [targetElement]); }, /** * zoom function used into the plugin and accessible via direct call (ex : $('#zoomImage').smartZoom('zoom', 0.2);)