Skip to content

Commit

Permalink
mouseenter/leave impl tweaks; close meteor#224 close meteor#198
Browse files Browse the repository at this point in the history
  • Loading branch information
dgreensp committed Jul 12, 2012
1 parent 75696a8 commit c3ecb78
Showing 1 changed file with 14 additions and 3 deletions.
17 changes: 14 additions & 3 deletions packages/liveui/liveevents_w3c.js
Original file line number Diff line number Diff line change
Expand Up @@ -118,9 118,20 @@ Meteor.ui._event._loadW3CImpl = function() {
Meteor.ui._event._handleEventFunc(
Meteor.ui._event._fixEvent(event));


// fire mouseleave after mouseout
if (simulateMouseEnterLeave && event.currentTarget !== event.relatedTarget && !jQuery.contains(event.currentTarget, event.relatedTarget)) {
// event ordering: fire mouseleave after mouseout
if (simulateMouseEnterLeave &&
// We respond to mouseover/mouseout here even on
// bubble, i.e. when event.currentTarget !== event.target,
// to ensure we see every enter and leave.
// We ignore the case where the mouse enters from
// a child or leaves to a child (by checking if
// relatedTarget is present and a descendent).
(! event.relatedTarget ||
(event.currentTarget !== event.relatedTarget &&
// XXX change this to call domutils.js when
// davidchunks branch lands
! Meteor.ui._Patcher._elementContains(
event.currentTarget, event.relatedTarget)))) {
if (event.type === 'mouseover'){
sendUIEvent('mouseenter', event.currentTarget, false);
}
Expand Down

0 comments on commit c3ecb78

Please sign in to comment.