aboutsummaryrefslogtreecommitdiffstats
path: root/test/unit/event.js
diff options
context:
space:
mode:
authorDave Methvin <dave.methvin@gmail.com>2011-10-05 21:41:32 -0400
committerDave Methvin <dave.methvin@gmail.com>2011-10-05 21:41:32 -0400
commite5b16e3356358a17c54c647b129e44cb09076ec8 (patch)
tree637981f7cafaa8b0fe9254942df4ad822d2b254b /test/unit/event.js
parent30cc7ae75cb9a65db70168340a7d3717ab8a0e9e (diff)
downloadjquery-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.js18
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(){
cense for more details. * * You should have received a copy of the GNU General Public License * along with this software; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, * USA. */ #ifndef __KEYBOARD_H__ #define __KEYBOARD_H__ #include <stdint.h> class KeyboardHandler { public: virtual void handleKeyPress(int systemKeyCode, uint32_t keyCode, uint32_t keySym) = 0; virtual void handleKeyRelease(int systemKeyCode) = 0; }; class Keyboard { public: Keyboard(KeyboardHandler* handler_) : handler(handler_) {}; virtual ~Keyboard() {}; virtual bool handleEvent(const void* event) = 0; virtual void reset() {}; virtual unsigned getLEDState() = 0; virtual void setLEDState(unsigned state) = 0; protected: KeyboardHandler* handler; }; #endif