From 233c3a357a1af50f80c232492ad6850d25fc16e5 Mon Sep 17 00:00:00 2001 From: Luke Murray Date: Fri, 12 Jul 2013 16:51:56 +1000 Subject: [PATCH] Add the option for a zoom handler callback --- src/drawer.js | 5 ++++- src/overlay.js | 5 +++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/drawer.js b/src/drawer.js index a5cc8ac9..10281190 100644 --- a/src/drawer.js +++ b/src/drawer.js @@ -430,7 +430,10 @@ $.Drawer.prototype = { $.OverlayPlacement[overlay.placement.toUpperCase()] ); }else{ - return new $.Overlay( element, rect ); + var newOverlay = new $.Overlay(element, rect); + if (overlay.zoomHandler) + newOverlay.zoomHandler = overlay.zoomHandler; + return newOverlay; } } diff --git a/src/overlay.js b/src/overlay.js index d175eb7c..acee3316 100644 --- a/src/overlay.js +++ b/src/overlay.js @@ -176,6 +176,11 @@ this.size = $.getElementSize( element ); } + if (this.zoomHandler) { + this.zoomHandler(this.position, this.size, element); + return; + } + position = this.position; size = this.size;