From: Kyle Baggott Date: Tue, 2 Feb 2016 10:38:40 +0000 (+0000) Subject: moving the lastTouch save into the "one touch" more efficient X-Git-Url: https://adrianiainlam.tk/git/?p=dygraphs.git;a=commitdiff_plain;h=86ca574eef14ff7a301df9ceae0393c94ec9157a moving the lastTouch save into the "one touch" more efficient --- diff --git a/src/dygraph-interaction-model.js b/src/dygraph-interaction-model.js index 6cc5ed1..411aae4 100644 --- a/src/dygraph-interaction-model.js +++ b/src/dygraph-interaction-model.js @@ -414,9 +414,6 @@ Dygraph.Interaction.startTouch = function(event, g, context) { context.startTimeForDoubleTapMs = null; } - // save the last touch to check if it's a touchOVER - context.lastTouch = event; - var touches = []; for (var i = 0; i < event.touches.length; i++) { var t = event.touches[i]; @@ -432,7 +429,9 @@ Dygraph.Interaction.startTouch = function(event, g, context) { context.initialTouches = touches; if (touches.length == 1) { - // This is just a swipe. + // This is possbily a touchOVER, save the last touch to check + context.lastTouch = event; + // or This is just a swipe. context.initialPinchCenter = touches[0]; context.touchDirections = { x: true, y: true }; } else if (touches.length >= 2) {