// *** attrChange attrName relatedNode srcElement are not normalized, non-W3C, deprecated, will be removed in 1.8 ***
props: "attrChange attrName relatedNode srcElement altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "),
- propHooks: {},
+ fixHooks: {},
keyHooks: {
props: "char charCode key keyCode".split(" "),
// Create a writable copy of the event object and normalize some properties
var originalEvent = event,
- propHook = jQuery.event.propHooks[ event.type ] || {},
- copy = propHook.props ? this.props.concat( propHook.props ) : this.props;
+ fixHook = jQuery.event.fixHooks[ event.type ] || {},
+ copy = fixHook.props ? this.props.concat( fixHook.props ) : this.props;
event = jQuery.Event( originalEvent );
event.metaKey = event.ctrlKey;
}
- return propHook.filter? propHook.filter( event, originalEvent ) : event;
+ return fixHook.filter? fixHook.filter( event, originalEvent ) : event;
},
// Deprecated, use jQuery.guid instead
}
if ( rkeyEvent.test( name ) ) {
- jQuery.event.propHooks[ name ] = jQuery.event.keyHooks;
+ jQuery.event.fixHooks[ name ] = jQuery.event.keyHooks;
}
if ( rmouseEvent.test( name ) ) {
- jQuery.event.propHooks[ name ] = jQuery.event.mouseHooks;
+ jQuery.event.fixHooks[ name ] = jQuery.event.mouseHooks;
}
});
markup.remove();
});
-test("propHooks extensions", function() {
+test("fixHooks extensions", function() {
expect( 2 );
// IE requires focusable elements to be visible, so append to body
var $fixture = jQuery( "<input type='text' id='hook-fixture' />" ).appendTo( "body" ),
- saved = jQuery.event.propHooks.click;
+ saved = jQuery.event.fixHooks.click;
// Ensure the property doesn't exist
$fixture.bind( "click", function( event ) {
ok( !("blurrinessLevel" in event), "event.blurrinessLevel does not exist" );
})[0].click();
+ $fixture.unbind( "click" );
- // Must blur the link so click works below
- $fixture.unbind( "click" )[0].blur();
-
- // Define a custom property for "click" events via the filter function
- //ok( !jQuery.event.propHooks.click, "We aren't clobbering an existing click hook" );
-
-
- jQuery.event.propHooks.click = {
+ jQuery.event.fixHooks.click = {
filter: function( event, originalEvent ) {
event.blurrinessLevel = 42;
return event;
equals( event.blurrinessLevel, 42, "event.blurrinessLevel was set" );
})[0].click();
- delete jQuery.event.propHooks.click;
+ delete jQuery.event.fixHooks.click;
$fixture.unbind( "click" ).remove();
- jQuery.event.propHooks.click = saved;
+ jQuery.event.fixHooks.click = saved;
});
(function(){