Skip to content

Commit

Permalink
add mouse event props to virtual mouse events Fixes jquery-archive#3280
Browse files Browse the repository at this point in the history
  • Loading branch information
johnbender committed Dec 15, 2011
1 parent c7e1bf0 commit 75b50f2
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions js/jquery.mobile.vmouse.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ var dataPropertyName = "virtualMouseBindings",
touchTargetPropertyName = "virtualTouchID",
virtualEventNames = "vmouseover vmousedown vmousemove vmouseup vclick vmouseout vmousecancel".split( " " ),
touchEventProps = "clientX clientY pageX pageY screenX screenY".split( " " ),
mouseEventProps = $.event.props.concat( $.event.mouseHooks.props ),
activeDocHandlers = {},
resetTimerID = 0,
startX = 0,
Expand Down Expand Up @@ -61,6 +62,12 @@ function createVirtualEvent( event, eventType ) {
oe = event.originalEvent;
props = $.event.props;

// 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 ) {
props = mouseEventProps;
}

// copy original event properties over to the new event
// this would happen if we could call $.event.fix instead of $.Event
// but we don't have a way to force an event to be fixed multiple times
Expand Down

0 comments on commit 75b50f2

Please sign in to comment.