Skip to content
This repository
Browse code

Fix for issue #3815 - vclick events don't have pageX/pageY defined on…

… them

- Modified createVirtualEvent() so that it uses the mouseHook properties if the original event type starts with "mouse" or "click". The original regex was only looking for "mouse".
  • Loading branch information...
commit 9856ba36805dcc3b2decddf02e2da969c5bc815c 1 parent e88fd48
Kin Blas authored March 14, 2012

Showing 1 changed file with 1 addition and 1 deletion. Show diff stats Hide diff stats

  1. 2  js/jquery.mobile.vmouse.js
2  js/jquery.mobile.vmouse.js
@@ -68,7 +68,7 @@ function createVirtualEvent( event, eventType ) {
68 68
 
69 69
 	// addresses separation of $.event.props in to $.event.mouseHook.props and Issue 3280
70 70
 	// https://github.com/jquery/jquery-mobile/issues/3280
71  
-	if ( t.search(/mouse/) >-1 ) {
  71
+	if ( t.search( /^(mouse|click)/ ) > -1 ) {
72 72
 		props = mouseEventProps;
73 73
 	}
74 74
 

2 notes on commit 9856ba3

Markus Staab

Should this regex be cached?

Kin Blas

@staabm

Yeah, it probably should given the fact that it could be triggered quite frequently for touchmove/mousemove events. I think there's another regex in that same function looking for touch events too.

Please sign in to comment.
Something went wrong with that request. Please try again.