Skip to content

Commit

Permalink
fix41: Handle the case where the user is using a mouse on a browser t…
Browse files Browse the repository at this point in the history
…hat supports touch events, causing touchEvent to be undefined in _mouseDown and _mouseMove.
  • Loading branch information
RandScullard committed May 7, 2015
1 parent c8e60b2 commit 33e04a1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions jquery.ui.touch-punch.js
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@

_mouseDown.call(self, event);

if (event.isDefaultPrevented()) {
if (event.isDefaultPrevented() && touchEvent) {
touchEvent.preventDefault();
touchStartDefaultPrevented = true;
}
Expand All @@ -223,7 +223,7 @@

_mouseMove.call(self, event);

if (event.isDefaultPrevented()) {
if (event.isDefaultPrevented() && touchEvent) {
touchEvent.preventDefault();
}
};
Expand Down

0 comments on commit 33e04a1

Please sign in to comment.