Skip to content

Commit

Permalink
current state
Browse files Browse the repository at this point in the history
  • Loading branch information
rwaldron committed Sep 23, 2011
1 parent c7f3b61 commit c80ad25
Showing 1 changed file with 14 additions and 5 deletions.
19 changes: 14 additions & 5 deletions src/event.js
Original file line number Diff line number Diff line change
Expand Up @@ -475,7 +475,7 @@ jQuery.event = {
return event.result;
},

props: "altKey attrChange attrName bubbles button cancelable charCode clientX clientY ctrlKey currentTarget data detail eventPhase fromElement handler keyCode layerX layerY metaKey newValue offsetX offsetY prevValue relatedNode relatedTarget screenX screenY shiftKey srcElement target toElement view wheelDelta which".split(" "),
props: "altKey attrName bubbles button cancelable charCode ctrlKey currentTarget data detail eventPhase fromElement handler keyCode metaKey relatedNode relatedTarget screenX screenY shiftKey srcElement target toElement view which".split(" "),

propHooks: {},

Expand All @@ -487,13 +487,17 @@ jQuery.event = {
// store a copy of the original event object
// and "clone" to set read-only properties
var originalEvent = event,
propHook;
propHook = jQuery.event.propHooks[ event.type ],
copy = this.props;

event = jQuery.Event( originalEvent );
propHook = jQuery.event.propHooks[ event.type ];

for ( var i = this.props.length, prop; i; ) {
prop = this.props[ --i ];
if ( propHook ) {
copy.push.apply( copy, propHook() || [] );
}

for ( var i = copy.length, prop; i; ) {
prop = copy[ --i ];
event[ prop ] = originalEvent[ prop ];
}

Expand Down Expand Up @@ -1093,6 +1097,10 @@ jQuery.each( ("blur focus focusin focusout load resize scroll unload click dblcl
if ( rmouseEvent.test( name ) ) {
jQuery.event.propHooks[ name ] = function( event, original ) {

if ( !event ) {
return "layerX layerY clientX clientY offsetX offsetY wheelDelta".split(" ");
}

var eventDoc, doc, body,
button = event.button;

Expand All @@ -1111,6 +1119,7 @@ jQuery.each( ("blur focus focusin focusout load resize scroll unload click dblcl
if ( !event.which && button !== undefined ) {
event.which = (button & 1 ? 1 : ( button & 2 ? 3 : ( button & 4 ? 2 : 0 ) ));
}

return event;
};
}});
Expand Down

0 comments on commit c80ad25

Please sign in to comment.