diff options
author | Dave Methvin <dave.methvin@gmail.com> | 2011-10-05 21:41:32 -0400 |
---|---|---|
committer | Dave Methvin <dave.methvin@gmail.com> | 2011-10-05 21:41:32 -0400 |
commit | e5b16e3356358a17c54c647b129e44cb09076ec8 (patch) | |
tree | 637981f7cafaa8b0fe9254942df4ad822d2b254b /test/unit/event.js | |
parent | 30cc7ae75cb9a65db70168340a7d3717ab8a0e9e (diff) | |
download | jquery-e5b16e3356358a17c54c647b129e44cb09076ec8.tar.gz jquery-e5b16e3356358a17c54c647b129e44cb09076ec8.zip |
Rename jQuery.event.propHooks to .fixHooks.
We already have jQuery.propHooks for the .prop() method, so using the same name for unrelated functionality on a sub-namespace is crazy talk. Since the method involved is jQuery.event.fix(), this will hopefully tie them together. Oh, and it's shorter.
Diffstat (limited to 'test/unit/event.js')
-rw-r--r-- | test/unit/event.js | 18 |
1 files changed, 6 insertions, 12 deletions
diff --git a/test/unit/event.js b/test/unit/event.js index 632254353..9bf9f788c 100644 --- a/test/unit/event.js +++ b/test/unit/event.js @@ -2386,26 +2386,20 @@ test("delegated events quickIs", function() { 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; @@ -2417,9 +2411,9 @@ test("propHooks extensions", function() { 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(){ |