From 6be5e7a89cce99a3343fa5f5a2ab77e551cf18f9 Mon Sep 17 00:00:00 2001 From: Tom MacWright Date: Tue, 27 Nov 2012 17:11:37 -0500 Subject: [PATCH] Fix map dragging and redrawing on touch --- js/iD/renderer/Map.js | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/js/iD/renderer/Map.js b/js/iD/renderer/Map.js index ca02bf773..78bc9f0ea 100644 --- a/js/iD/renderer/Map.js +++ b/js/iD/renderer/Map.js @@ -400,13 +400,14 @@ iD.Map = function(elem, connection) { } } - surface.on('mouseup', function() { - if (surface.style(transformProp)) { - translateStart = null; - surface.style(transformProp, ''); - redraw(); - } - }); + function resetTransform() { + if (!surface.style(transformProp)) return; + translateStart = null; + surface.style(transformProp, ''); + redraw(); + } + + surface.on('mouseup', resetTransform).on('touchend', resetTransform); function redraw(only) { if (!only) {