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 250a9e5
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 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
2 changes: 1 addition & 1 deletion jquery.ui.touch-punch.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 250a9e5

Please sign in to comment.