From: Dave Methvin Date: Thu, 8 Sep 2011 02:49:32 +0000 (-0400) Subject: Fix the special event handler for mouseover/out events. X-Git-Tag: 1.7b1~52 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=0ec71ac707fc3edce6ee67a54da6c779164812f4;p=jquery.git Fix the special event handler for mouseover/out events. And use the /dist version of jquery.js, willya? --- diff --git a/src/event.js b/src/event.js index 2b05d9a64..fc43ed1ae 100644 --- a/src/event.js +++ b/src/event.js @@ -717,11 +717,13 @@ jQuery.each({ selector = handleObj.selector, oldType, ret; + // NB: No relatedTarget if the mouse left/entered the browser window if ( selector && related ) { // Delegated event; find the real relatedTarget related = jQuery( related ).closest( selector )[0]; } - if ( !related || related !== target && !jQuery.contains( target, related ) ) { + // For mouseover/out, contains isn't needed; handle() already determined it's the right target + if ( !related || handleObj.origType === event.type || (related !== target && !jQuery.contains( target, related )) ) { oldType = event.type; event.type = handleObj.origType; ret = handleObj.handler.apply( this, arguments ); diff --git a/test/hovertest.html b/test/hovertest.html index 2c7267408..4c101ec00 100644 --- a/test/hovertest.html +++ b/test/hovertest.html @@ -1,7 +1,7 @@ Hover tests - +