Skip to content

Commit 4534db1

Browse files
committed
Fix #11021. There should be no mangling of the "hover" namespace.
1 parent 5798eab commit 4534db1

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

src/event.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
var rformElems = /^(?:textarea|input|select)$/i,
44
rtypenamespace = /^([^\.]*)?(?:\.(.+))?$/,
5-
rhoverHack = /\bhover(\.\S+)?\b/,
5+
rhoverHack = /(?:^|\s)hover(\.\S+)?\b/,
66
rkeyEvent = /^key/,
77
rmouseEvent = /^(?:mouse|contextmenu)|click/,
88
rfocusMorph = /^(?:focusinfocus|focusoutblur)$/,

test/unit/event.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -787,7 +787,7 @@ test("unbind(eventObject)", function() {
787787
});
788788

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

792792
var times = 0,
793793
handler1 = function( event ) { ++times; },
@@ -810,6 +810,9 @@ test("hover() and hover pseudo-event", function() {
810810
.on( "hovercraft", function() {
811811
ok( false, "hovercraft is full of ills" );
812812
})
813+
.on( "click.hover.me.not", function( e ) {
814+
equal( e.handleObj.namespace, "hover.me.not", "hover hack doesn't mangle namespaces" );
815+
})
813816
.bind("hover", function( e ) {
814817
if ( e.type === "mouseenter" ) {
815818
balance++;
@@ -819,6 +822,7 @@ test("hover() and hover pseudo-event", function() {
819822
ok( false, "hover pseudo: unknown event type "+e.type );
820823
}
821824
})
825+
.trigger("click")
822826
.trigger("mouseenter")
823827
.trigger("mouseleave")
824828
.unbind("hover")

0 commit comments

Comments
 (0)