Skip to content

Commit

Permalink
Fix the special event handler for mouseover/out events.
Browse files Browse the repository at this point in the history
And use the /dist version of jquery.js, willya?
  • Loading branch information
dmethvin authored and timmywil committed Sep 19, 2011
1 parent 8ba5010 commit 0ec71ac
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion src/event.js
Expand Up @@ -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 );
Expand Down
2 changes: 1 addition & 1 deletion test/hovertest.html
@@ -1,7 +1,7 @@
<html>
<head>
<title>Hover tests</title>
<script src="http://code.jquery.com/jquery-1.6.2.js" type='text/javascript'></script>
<script src="../dist/jquery.js" type='text/javascript'></script>
<style>
/* Remove body dimensions so we can test enter/leave to surrounding browser chrome */
body, html {
Expand Down

0 comments on commit 0ec71ac

Please sign in to comment.