@@ -141,7 +141,7 @@ define( [ "jquery", "../jquery.mobile.vmouse", "../jquery.mobile.support.touch"
141141
142142 durationThreshold : 1000 , // More time than this, and it isn't a swipe.
143143
144- horizontalDistanceThreshold : 30 , // Swipe horizontal displacement must be more than this.
144+ horizontalDistanceThreshold : 10 , // Swipe horizontal displacement must be more than this.
145145
146146 verticalDistanceThreshold : 75 , // Swipe vertical displacement must be less than this.
147147
@@ -172,7 +172,10 @@ define( [ "jquery", "../jquery.mobile.vmouse", "../jquery.mobile.support.touch"
172172
173173 triggerCustomEvent ( thisObject , "swipe" , $ . Event ( "swipe" , { target : origTarget } ) ) ;
174174 triggerCustomEvent ( thisObject , direction , $ . Event ( direction , { target : origTarget } ) ) ;
175+ return true ;
175176 }
177+ return false ;
178+
176179 } ,
177180
178181 setup : function ( ) {
@@ -182,15 +185,18 @@ define( [ "jquery", "../jquery.mobile.vmouse", "../jquery.mobile.support.touch"
182185 $this . bind ( touchStartEvent , function ( event ) {
183186 var stop ,
184187 start = $ . event . special . swipe . start ( event ) ,
185- origTarget = event . target ;
188+ origTarget = event . target ,
189+ emitted = false ;
186190
187191 function moveHandler ( event ) {
188192 if ( ! start ) {
189193 return ;
190194 }
191195
192196 stop = $ . event . special . swipe . stop ( event ) ;
193-
197+ if ( ! emitted ) {
198+ emitted = $ . event . special . swipe . handleSwipe ( start , stop , thisObject , origTarget ) ;
199+ }
194200 // prevent scrolling
195201 if ( Math . abs ( start . coords [ 0 ] - stop . coords [ 0 ] ) > $ . event . special . swipe . scrollSupressionThreshold ) {
196202 event . preventDefault ( ) ;
@@ -199,12 +205,7 @@ define( [ "jquery", "../jquery.mobile.vmouse", "../jquery.mobile.support.touch"
199205
200206 $this . bind ( touchMoveEvent , moveHandler )
201207 . one ( touchStopEvent , function ( ) {
202- $this . unbind ( touchMoveEvent , moveHandler ) ;
203-
204- if ( start && stop ) {
205- $ . event . special . swipe . handleSwipe ( start , stop , thisObject , origTarget ) ;
206- }
207- start = stop = undefined ;
208+ emitted = false ;
208209 } ) ;
209210 } ) ;
210211 } ,
0 commit comments