From 43d15f830f9d419c41c41f0682e47e86839e3917 Mon Sep 17 00:00:00 2001 From: Misko Hevery Date: Fri, 20 Apr 2012 11:27:35 -0700 Subject: [PATCH] fix(mouseenter): FF no longer throws exceptions --- src/jqLite.js | 2 -- test/jqLiteSpec.js | 8 ++++---- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/src/jqLite.js b/src/jqLite.js index 0d00d091d25e..390013b223d6 100644 --- a/src/jqLite.js +++ b/src/jqLite.js @@ -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); } }); diff --git a/test/jqLiteSpec.js b/test/jqLiteSpec.js index afbb6836238a..34b5decdd65f 100644 --- a/test/jqLiteSpec.js +++ b/test/jqLiteSpec.js @@ -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() {