Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

Commit 43d15f8

Browse files
committed
fix(mouseenter): FF no longer throws exceptions
1 parent 1d26acb commit 43d15f8

File tree

2 files changed

+4
-6
lines changed

2 files changed

+4
-6
lines changed

src/jqLite.js

-2
Original file line numberDiff line numberDiff line change
@@ -559,14 +559,12 @@ forEach({
559559
bindFn(element, 'mouseover', function(event) {
560560
counter++;
561561
if (counter == 1) {
562-
event.type = 'mouseenter';
563562
mouseenter(event);
564563
}
565564
});
566565
bindFn(element, 'mouseout', function(event) {
567566
counter --;
568567
if (counter == 0) {
569-
event.type = 'mouseleave';
570568
mouseleave(event);
571569
}
572570
});

test/jqLiteSpec.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -691,13 +691,13 @@ describe('jqLite', function() {
691691

692692
parent.bind('mouseenter', function() { log += 'parentEnter;'; });
693693
parent.bind('mouseleave', function() { log += 'parentLeave;'; });
694-
parent.mouseover = function(event) { parent.data('bind').mouseover(event || {}); };
695-
parent.mouseout = function(event) { parent.data('bind').mouseout(event || {}); };
694+
parent.mouseover = function() { browserTrigger(parent, 'mouseover'); };
695+
parent.mouseout = function() { browserTrigger(parent, 'mouseout'); };
696696

697697
child.bind('mouseenter', function() { log += 'childEnter;'; });
698698
child.bind('mouseleave', function() { log += 'childLeave;'; });
699-
child.mouseover = function(event) { child.data('bind').mouseover(event || {}); };
700-
child.mouseout = function(event) { child.data('bind').mouseout(event || {}); };
699+
child.mouseover = function() { browserTrigger(child, 'mouseover'); };
700+
child.mouseout = function() { browserTrigger(child, 'mouseout'); };
701701
});
702702

703703
afterEach(function() {

0 commit comments

Comments
 (0)