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

Commit

Permalink
Fix for issue #3815 - vclick events don't have pageX/pageY defined on…
Browse files Browse the repository at this point in the history
… 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
jblas committed Mar 14, 2012
1 parent e88fd48 commit 9856ba3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion js/jquery.mobile.vmouse.js
Expand Up @@ -68,7 +68,7 @@ function createVirtualEvent( event, eventType ) {

// addresses separation of $.event.props in to $.event.mouseHook.props and Issue 3280
// https://github.com/jquery/jquery-mobile/issues/3280
if ( t.search(/mouse/) >-1 ) {
if ( t.search( /^(mouse|click)/ ) > -1 ) {
props = mouseEventProps;
}

Expand Down

2 comments on commit 9856ba3

@staabm
Copy link
Contributor

@staabm staabm commented on 9856ba3 Mar 14, 2012

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this regex be cached?

@jblas
Copy link
Contributor Author

@jblas jblas commented on 9856ba3 Mar 14, 2012

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@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.