Permalink
Browse files

Events: Clear tap when taphold occurs

Fixes #6692
Closes #8452
  • Loading branch information...
apsdehal authored and arschmitz committed Jun 22, 2016
1 parent c0bba0d commit 75816286e5fb0e274bacc160a4726dcd17df61eb
Showing with 7 additions and 3 deletions.
  1. +7 −3 js/events/touch.js
View
@@ -76,7 +76,10 @@ $.event.special.tap = {
timer, clickHandler;
function clearTapTimer() {
clearTimeout( timer );
if ( timer ) {
$this.bind( "vclick", clickHandler );
clearTimeout( timer );
}
}
function clearTapHandlers() {
@@ -99,14 +102,15 @@ $.event.special.tap = {
}
};
$this.bind( "vmouseup", clearTapTimer )
.bind( "vclick", clickHandler );
$this.bind( "vmouseup", clearTapTimer );
$document.bind( "vmousecancel", clearTapHandlers );
timer = setTimeout( function() {
if ( !$.event.special.tap.emitTapOnTaphold ) {
isTaphold = true;
}
timer = 0;
triggerCustomEvent( thisObject, "taphold", $.Event( "taphold", { target: origTarget } ) );
}, $.event.special.tap.tapholdThreshold );
} );

0 comments on commit 7581628

Please sign in to comment.