Skip to content
This repository has been archived by the owner on Oct 8, 2021. It is now read-only.

Commit

Permalink
Taphold: fix new option to supress tap per comments on pr #5980
Browse files Browse the repository at this point in the history
  • Loading branch information
arschmitz committed May 9, 2013
1 parent fd2be73 commit 57e857f
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions js/events/touch.js
Expand Up @@ -110,7 +110,7 @@ define( [ "jquery", "../jquery.mobile.vmouse", "../jquery.mobile.support.touch"

// ONLY trigger a 'tap' event if the start target is
// the same as the stop target.
if ( $.event.special.tap.emitTapOnTaphold && !isTaphold && origTarget === event.target ) {
if ( !isTaphold && origTarget === event.target ) {
triggerCustomEvent( thisObject, "tap", event );
}
}
Expand All @@ -120,7 +120,9 @@ define( [ "jquery", "../jquery.mobile.vmouse", "../jquery.mobile.support.touch"
$document.bind( "vmousecancel", clearTapHandlers );

timer = setTimeout( function() {
isTaphold = true;
if( $.event.special.tap.emitTapOnTaphold ) {
isTaphold = true;
}
triggerCustomEvent( thisObject, "taphold", $.Event( "taphold", { target: origTarget } ) );
}, $.event.special.tap.tapholdThreshold );
});
Expand Down

0 comments on commit 57e857f

Please sign in to comment.