From 0735c44f87e20092caba78fd06708d6943136d3e Mon Sep 17 00:00:00 2001 From: Patrick Mead Date: Fri, 10 May 2019 16:16:01 +0930 Subject: [PATCH] Fix UMD file not being updated for v2.3.2 --- dist/pinch-zoom.umd.js | 46 ++++++++++++++++++++++++++++++++++-------- 1 file changed, 38 insertions(+), 8 deletions(-) diff --git a/dist/pinch-zoom.umd.js b/dist/pinch-zoom.umd.js index 69c6332..3e723e1 100644 --- a/dist/pinch-zoom.umd.js +++ b/dist/pinch-zoom.umd.js @@ -17,23 +17,23 @@ value: true }); /* - + PinchZoom.js Copyright (c) Manuel Stofer 2013 - today - + Author: Manuel Stofer (mst@rtp.ch) Version: 2.3.2 - + Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: - + The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. - + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE @@ -41,7 +41,7 @@ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - + */ // polyfills @@ -158,7 +158,14 @@ dragEndEventName: 'pz_dragend', doubleTapEventName: 'pz_doubletap', verticalPadding: 0, - horizontalPadding: 0 + horizontalPadding: 0, + onZoomStart: null, + onZoomEnd: null, + onZoomUpdate: null, + onDragStart: null, + onDragEnd: null, + onDragUpdate: null, + onDoubleTap: null }, /** @@ -167,6 +174,9 @@ */ handleDragStart: function handleDragStart(event) { triggerEvent(this.el, this.options.dragStartEventName); + if (typeof this.options.onDragStart == "function") { + this.options.onDragStart(this, event); + } this.stopAnimation(); this.lastDragPosition = false; this.hasInteraction = true; @@ -186,6 +196,9 @@ handleDragEnd: function handleDragEnd() { triggerEvent(this.el, this.options.dragEndEventName); + if (typeof this.options.onDragEnd == "function") { + this.options.onDragEnd(this, event); + } this.end(); }, @@ -195,6 +208,9 @@ */ handleZoomStart: function handleZoomStart(event) { triggerEvent(this.el, this.options.zoomStartEventName); + if (typeof this.options.onZoomStart == "function") { + this.options.onZoomStart(this, event); + } this.stopAnimation(); this.lastScale = 1; this.nthZoom = 0; @@ -224,6 +240,9 @@ handleZoomEnd: function handleZoomEnd() { triggerEvent(this.el, this.options.zoomEndEventName); + if (typeof this.options.onZoomEnd == "function") { + this.options.onZoomEnd(this, event); + } this.end(); }, @@ -251,6 +270,9 @@ this.animate(this.options.animationDuration, updateProgress, this.swing); triggerEvent(this.el, this.options.doubleTapEventName); + if (typeof this.options.onDoubleTap == "function") { + this.options.onDoubleTap(this, event); + } }, /** @@ -337,6 +359,9 @@ y: (_scale - 1) * (center.y + this.offset.y) }); triggerEvent(this.el, this.options.zoomUpdateEventName); + if (typeof this.options.onZoomUpdate == "function") { + this.options.onZoomUpdate(this, event); + } }, /** @@ -390,6 +415,9 @@ }); } triggerEvent(this.el, this.options.dragUpdateEventName); + if (typeof this.options.onDragUpdate == "function") { + this.options.onDragUpdate(this, event); + } } }, @@ -857,7 +885,9 @@ } else { switch (interaction) { case 'zoom': - target.handleZoom(event, calculateScale(startTouches, targetTouches(event.touches))); + if (startTouches.length == 2 && event.touches.length == 2) { + target.handleZoom(event, calculateScale(startTouches, targetTouches(event.touches))); + } break; case 'drag': target.handleDrag(event);