@@ -78,13 +78,14 @@ define( [ "jquery", "../jquery.mobile.vmouse", "../jquery.mobile.support.touch"
7878 // also handles taphold
7979 $ . event . special . tap = {
8080 tapholdThreshold : 750 ,
81-
81+ emitTapOnTaphold : true ,
8282 setup : function ( ) {
8383 var thisObject = this ,
84- $this = $ ( thisObject ) ;
84+ $this = $ ( thisObject ) ,
85+ isTaphold = false ;
8586
8687 $this . bind ( "vmousedown" , function ( event ) {
87-
88+ isTaphold = false ;
8889 if ( event . which && event . which !== 1 ) {
8990 return false ;
9091 }
@@ -109,7 +110,7 @@ define( [ "jquery", "../jquery.mobile.vmouse", "../jquery.mobile.support.touch"
109110
110111 // ONLY trigger a 'tap' event if the start target is
111112 // the same as the stop target.
112- if ( origTarget === event . target ) {
113+ if ( $ . event . special . tap . emitTapOnTaphold && ! isTaphold && origTarget === event . target ) {
113114 triggerCustomEvent ( thisObject , "tap" , event ) ;
114115 }
115116 }
@@ -119,6 +120,7 @@ define( [ "jquery", "../jquery.mobile.vmouse", "../jquery.mobile.support.touch"
119120 $document . bind ( "vmousecancel" , clearTapHandlers ) ;
120121
121122 timer = setTimeout ( function ( ) {
123+ isTaphold = true ;
122124 triggerCustomEvent ( thisObject , "taphold" , $ . Event ( "taphold" , { target : origTarget } ) ) ;
123125 } , $ . event . special . tap . tapholdThreshold ) ;
124126 } ) ;
0 commit comments