Skip to content

Commit

Permalink
Fix #11021. There should be no mangling of the "hover" namespace.
Browse files Browse the repository at this point in the history
  • Loading branch information
dmethvin committed Dec 14, 2011
1 parent 5798eab commit 4534db1
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/event.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

var rformElems = /^(?:textarea|input|select)$/i,
rtypenamespace = /^([^\.]*)?(?:\.(.+))?$/,
rhoverHack = /\bhover(\.\S+)?\b/,
rhoverHack = /(?:^|\s)hover(\.\S+)?\b/,
rkeyEvent = /^key/,
rmouseEvent = /^(?:mouse|contextmenu)|click/,
rfocusMorph = /^(?:focusinfocus|focusoutblur)$/,
Expand Down
6 changes: 5 additions & 1 deletion test/unit/event.js
Original file line number Diff line number Diff line change
Expand Up @@ -787,7 +787,7 @@ test("unbind(eventObject)", function() {
});

test("hover() and hover pseudo-event", function() {
expect(2);
expect(3);

var times = 0,
handler1 = function( event ) { ++times; },
Expand All @@ -810,6 +810,9 @@ test("hover() and hover pseudo-event", function() {
.on( "hovercraft", function() {
ok( false, "hovercraft is full of ills" );
})
.on( "click.hover.me.not", function( e ) {
equal( e.handleObj.namespace, "hover.me.not", "hover hack doesn't mangle namespaces" );
})
.bind("hover", function( e ) {
if ( e.type === "mouseenter" ) {
balance++;
Expand All @@ -819,6 +822,7 @@ test("hover() and hover pseudo-event", function() {
ok( false, "hover pseudo: unknown event type "+e.type );
}
})
.trigger("click")
.trigger("mouseenter")
.trigger("mouseleave")
.unbind("hover")
Expand Down

0 comments on commit 4534db1

Please sign in to comment.