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

Commit

Permalink
fix(mouseenter): FF no longer throws exceptions
Browse files Browse the repository at this point in the history
  • Loading branch information
mhevery committed Apr 21, 2012
1 parent 1d26acb commit 43d15f8
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
2 changes: 0 additions & 2 deletions src/jqLite.js
Original file line number Diff line number Diff line change
Expand Up @@ -559,14 +559,12 @@ forEach({
bindFn(element, 'mouseover', function(event) {
counter++;
if (counter == 1) {
event.type = 'mouseenter';
mouseenter(event);
}
});
bindFn(element, 'mouseout', function(event) {
counter --;
if (counter == 0) {
event.type = 'mouseleave';
mouseleave(event);
}
});
Expand Down
8 changes: 4 additions & 4 deletions test/jqLiteSpec.js
Original file line number Diff line number Diff line change
Expand Up @@ -691,13 +691,13 @@ describe('jqLite', function() {

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

child.bind('mouseenter', function() { log += 'childEnter;'; });
child.bind('mouseleave', function() { log += 'childLeave;'; });
child.mouseover = function(event) { child.data('bind').mouseover(event || {}); };
child.mouseout = function(event) { child.data('bind').mouseout(event || {}); };
child.mouseover = function() { browserTrigger(child, 'mouseover'); };
child.mouseout = function() { browserTrigger(child, 'mouseout'); };
});

afterEach(function() {
Expand Down

0 comments on commit 43d15f8

Please sign in to comment.