Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions jquery.ui.touch-punch.js
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@
touchHandled = true;

// Track movement to determine if interaction was a click
self._touchMoved = false;
self._touchMoved = 0;

// Simulate the mouseover event
simulateMouseEvent(event, 'mouseover');
Expand All @@ -103,8 +103,8 @@
return;
}

// Interaction was not a click
this._touchMoved = true;
// Interaction was less likely to be a click
this._touchMoved +=1;

// Simulate the mousemove event
simulateMouseEvent(event, 'mousemove');
Expand All @@ -127,8 +127,8 @@
// Simulate the mouseout event
simulateMouseEvent(event, 'mouseout');

// If the touch interaction did not move, it should trigger a click
if (!this._touchMoved) {
// If the touch interaction did not move (much), it should trigger a click
if (this._touchMoved<=5) {

// Simulate the click event
simulateMouseEvent(event, 'click');
Expand Down Expand Up @@ -177,4 +177,4 @@
_mouseDestroy.call(self);
};

})(jQuery);
})(jQuery);