From 33e04a117329e2acd4cb89931d5f5e160ef2c42b Mon Sep 17 00:00:00 2001 From: Rand Scullard Date: Thu, 7 May 2015 09:25:31 -0400 Subject: [PATCH] fix41: Handle the case where the user is using a mouse on a browser that supports touch events, causing touchEvent to be undefined in _mouseDown and _mouseMove. --- jquery.ui.touch-punch.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/jquery.ui.touch-punch.js b/jquery.ui.touch-punch.js index 0e26f14..1197f26 100755 --- a/jquery.ui.touch-punch.js +++ b/jquery.ui.touch-punch.js @@ -206,7 +206,7 @@ _mouseDown.call(self, event); - if (event.isDefaultPrevented()) { + if (event.isDefaultPrevented() && touchEvent) { touchEvent.preventDefault(); touchStartDefaultPrevented = true; } @@ -223,7 +223,7 @@ _mouseMove.call(self, event); - if (event.isDefaultPrevented()) { + if (event.isDefaultPrevented() && touchEvent) { touchEvent.preventDefault(); } };