<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[19605] trunk/wp-includes/js: hoverIntent r6.</title>
</head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg > ul, #logmsg > ol { margin-left: 0; margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://core.trac.wordpress.org/changeset/19605">19605</a></dd>
<dt>Author</dt> <dd>nacin</dd>
<dt>Date</dt> <dd>2011-12-20 20:54:54 +0000 (Tue, 20 Dec 2011)</dd>
</dl>

<h3>Log Message</h3>
<pre>hoverIntent r6. fixes <a href="http://core.trac.wordpress.org/ticket/19311">#19311</a>.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkwpincludesjshoverIntentdevjs">trunk/wp-includes/js/hoverIntent.dev.js</a></li>
<li><a href="#trunkwpincludesjshoverIntentjs">trunk/wp-includes/js/hoverIntent.js</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkwpincludesjshoverIntentdevjs"></a>
<div class="modfile"><h4>Modified: trunk/wp-includes/js/hoverIntent.dev.js (19604 => 19605)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-includes/js/hoverIntent.dev.js        2011-12-20 20:46:06 UTC (rev 19604)
+++ trunk/wp-includes/js/hoverIntent.dev.js        2011-12-20 20:54:54 UTC (rev 19605)
</span><span class="lines">@@ -4,7 +4,7 @@
</span><span class="cx"> * to see if the user's mouse has slowed down (beneath the sensitivity
</span><span class="cx"> * threshold) before firing the onMouseOver event.
</span><span class="cx"> * 
</span><del>-* hoverIntent r5 // 2007.03.27 // jQuery 1.1.2+
</del><ins>+* hoverIntent r6 // 2011.02.26 // jQuery 1.5.1+
</ins><span class="cx"> * &lt;http://cherne.net/brian/resources/jquery.hoverIntent.html&gt;
</span><span class="cx"> * 
</span><span class="cx"> * hoverIntent is currently available for use in all personal or commercial 
</span><span class="lines">@@ -25,7 +25,7 @@
</span><span class="cx"> * 
</span><span class="cx"> * @param  f  onMouseOver function || An object with configuration options
</span><span class="cx"> * @param  g  onMouseOut function  || Nothing (use configuration options object)
</span><del>-* @author    Brian Cherne &lt;brian@cherne.net&gt;
</del><ins>+* @author    Brian Cherne brian(at)cherne(dot)net
</ins><span class="cx"> */
</span><span class="cx"> (function($) {
</span><span class="cx">         $.fn.hoverIntent = function(f,g) {
</span><span class="lines">@@ -72,40 +72,18 @@
</span><span class="cx">                         ob.hoverIntent_s = 0;
</span><span class="cx">                         return cfg.out.apply(ob,[ev]);
</span><span class="cx">                 };
</span><del>-                
-                // workaround for Mozilla bug: not firing mouseout/mouseleave on absolute positioned elements over textareas and input type=&quot;text&quot;
-                var handleHover = function(e) {
-                        var t = this;
-                        
-                        // next two lines copied from jQuery.hover, ignore children onMouseOver/onMouseOut
-                        var p = (e.type == &quot;mouseover&quot; ? e.fromElement : e.toElement) || e.relatedTarget;
-                        while ( p &amp;&amp; p != this ) { try { p = p.parentNode; } catch(e) { p = this; } }
-                        if ( p == this ) {
-                                if ( $.browser.mozilla ) {
-                                        if ( e.type == &quot;mouseout&quot; ) {
-                                                t.mtout = setTimeout( function(){doHover(e,t);}, 30 );
-                                        } else {
-                                                if (t.mtout) { t.mtout = clearTimeout(t.mtout); }
-                                        }
-                                }
-                                return;
-                        } else {
-                                if (t.mtout) { t.mtout = clearTimeout(t.mtout); }
-                                doHover(e,t);
-                        }
-                };
</del><span class="cx"> 
</span><span class="cx">                 // A private function for handling mouse 'hovering'
</span><del>-                var doHover = function(e,ob) {
-
</del><ins>+                var handleHover = function(e) {
</ins><span class="cx">                         // copy objects to be passed into t (required for event object to be passed in IE)
</span><span class="cx">                         var ev = jQuery.extend({},e);
</span><ins>+                        var ob = this;
</ins><span class="cx"> 
</span><span class="cx">                         // cancel hoverIntent timer if it exists
</span><span class="cx">                         if (ob.hoverIntent_t) { ob.hoverIntent_t = clearTimeout(ob.hoverIntent_t); }
</span><span class="cx"> 
</span><del>-                        // else e.type == &quot;onmouseover&quot;
-                        if (e.type == &quot;mouseover&quot;) {
</del><ins>+                        // if e.type == &quot;mouseenter&quot;
+                        if (e.type == &quot;mouseenter&quot;) {
</ins><span class="cx">                                 // set &quot;previous&quot; X and Y position based on initial entry point
</span><span class="cx">                                 pX = ev.pageX; pY = ev.pageY;
</span><span class="cx">                                 // update &quot;current&quot; X and Y position based on mousemove
</span><span class="lines">@@ -113,7 +91,7 @@
</span><span class="cx">                                 // start polling interval (self-calling timeout) to compare mouse coordinates over time
</span><span class="cx">                                 if (ob.hoverIntent_s != 1) { ob.hoverIntent_t = setTimeout( function(){compare(ev,ob);} , cfg.interval );}
</span><span class="cx"> 
</span><del>-                        // else e.type == &quot;onmouseout&quot;
</del><ins>+                        // else e.type == &quot;mouseleave&quot;
</ins><span class="cx">                         } else {
</span><span class="cx">                                 // unbind expensive mousemove event
</span><span class="cx">                                 $(ob).unbind(&quot;mousemove&quot;,track);
</span><span class="lines">@@ -123,6 +101,6 @@
</span><span class="cx">                 };
</span><span class="cx"> 
</span><span class="cx">                 // bind the function to the two event listeners
</span><del>-                return this.mouseover(handleHover).mouseout(handleHover);
</del><ins>+                return this.bind('mouseenter',handleHover).bind('mouseleave',handleHover);
</ins><span class="cx">         };
</span><span class="cx"> })(jQuery);
</span><span class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="trunkwpincludesjshoverIntentjs"></a>
<div class="modfile"><h4>Modified: trunk/wp-includes/js/hoverIntent.js (19604 => 19605)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-includes/js/hoverIntent.js        2011-12-20 20:46:06 UTC (rev 19604)
+++ trunk/wp-includes/js/hoverIntent.js        2011-12-20 20:54:54 UTC (rev 19605)
</span><span class="lines">@@ -1 +1 @@
</span><del>-(function(a){a.fn.hoverIntent=function(l,j){var m={sensitivity:7,interval:100,timeout:0};m=a.extend(m,j?{over:l,out:j}:l);var o,n,h,d;var e=function(f){o=f.pageX;n=f.pageY};var c=function(g,f){f.hoverIntent_t=clearTimeout(f.hoverIntent_t);if((Math.abs(h-o)+Math.abs(d-n))&lt;m.sensitivity){a(f).unbind(&quot;mousemove&quot;,e);f.hoverIntent_s=1;return m.over.apply(f,[g])}else{h=o;d=n;f.hoverIntent_t=setTimeout(function(){c(g,f)},m.interval)}};var i=function(g,f){f.hoverIntent_t=clearTimeout(f.hoverIntent_t);f.hoverIntent_s=0;return m.out.apply(f,[g])};var b=function(q){var f=this;var g=(q.type==&quot;mouseover&quot;?q.fromElement:q.toElement)||q.relatedTarget;while(g&amp;&amp;g!=this){try{g=g.parentNode}catch(q){g=this}}if(g==this){if(a.browser.mozilla){if(q.type==&quot;mouseout&quot;){f.mtout=setTimeout(function(){k(q,f)},30)}else{if(f.mtout){f.mtout=clearTimeout(f.mtout)}}}return}else{if(f.mtout){f.mtout=clearTimeout(f.mtout)}k(q,f)}};var k=function(p,f){var g=jQ
 uery.extend({},p);if(f.hoverIntent_t){f.hoverIntent_t=clearTimeout(f.hoverIntent_t)}if(p.type==&quot;mouseover&quot;){h=g.pageX;d=g.pageY;a(f).bind(&quot;mousemove&quot;,e);if(f.hoverIntent_s!=1){f.hoverIntent_t=setTimeout(function(){c(g,f)},m.interval)}}else{a(f).unbind(&quot;mousemove&quot;,e);if(f.hoverIntent_s==1){f.hoverIntent_t=setTimeout(function(){i(g,f)},m.timeout)}}};return this.mouseover(b).mouseout(b)}})(jQuery);
</del><span class="cx">\ No newline at end of file
</span><ins>+(function($){$.fn.hoverIntent=function(f,g){var cfg={sensitivity:7,interval:100,timeout:0};cfg=$.extend(cfg,g?{over:f,out:g}:f);var cX,cY,pX,pY;var track=function(ev){cX=ev.pageX;cY=ev.pageY};var compare=function(ev,ob){ob.hoverIntent_t=clearTimeout(ob.hoverIntent_t);if((Math.abs(pX-cX)+Math.abs(pY-cY))&lt;cfg.sensitivity){$(ob).unbind(&quot;mousemove&quot;,track);ob.hoverIntent_s=1;return cfg.over.apply(ob,[ev])}else{pX=cX;pY=cY;ob.hoverIntent_t=setTimeout(function(){compare(ev,ob)},cfg.interval)}};var delay=function(ev,ob){ob.hoverIntent_t=clearTimeout(ob.hoverIntent_t);ob.hoverIntent_s=0;return cfg.out.apply(ob,[ev])};var handleHover=function(e){var ev=jQuery.extend({},e);var ob=this;if(ob.hoverIntent_t){ob.hoverIntent_t=clearTimeout(ob.hoverIntent_t)}if(e.type==&quot;mouseenter&quot;){pX=ev.pageX;pY=ev.pageY;$(ob).bind(&quot;mousemove&quot;,track);if(ob.hoverIntent_s!=1){ob.hoverIntent_t=setTimeout(function(){compare(ev,ob)},cfg.interval)}}else{$(ob).unbind(&
 quot;mousemove&quot;,track);if(ob.hoverIntent_s==1){ob.hoverIntent_t=setTimeout(function(){delay(ev,ob)},cfg.timeout)}}};return this.bind('mouseenter',handleHover).bind('mouseleave',handleHover)}})(jQuery);
</ins><span class="cx">\ No newline at end of file
</span></span></pre>
</div>
</div>

</body>
</html>