<!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" /><style type="text/css"><!--
#msg dl { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer { 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 #fc0 solid; padding: 6px; }
#msg ul, pre { overflow: auto; }
#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>
<title>[16274] trunk/wp-includes: Admin bar hover fixes.</title>
</head>
<body>

<div id="msg">
<dl>
<dt>Revision</dt> <dd><a href="http://trac.wordpress.org/changeset/16274">16274</a></dd>
<dt>Author</dt> <dd>ryan</dd>
<dt>Date</dt> <dd>2010-11-10 16:19:55 +0000 (Wed, 10 Nov 2010)</dd>
</dl>

<h3>Log Message</h3>
<pre>Admin bar hover fixes. Props filosofo. see <a href="http://trac.wordpress.org/ticket/15307">#15307</a></pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkwpincludesjsadminbardevjs">trunk/wp-includes/js/admin-bar.dev.js</a></li>
<li><a href="#trunkwpincludesjsadminbarjs">trunk/wp-includes/js/admin-bar.js</a></li>
<li><a href="#trunkwpincludesscriptloaderphp">trunk/wp-includes/script-loader.php</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkwpincludesjsadminbardevjs"></a>
<div class="modfile"><h4>Modified: trunk/wp-includes/js/admin-bar.dev.js (16273 => 16274)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-includes/js/admin-bar.dev.js        2010-11-10 14:50:14 UTC (rev 16273)
+++ trunk/wp-includes/js/admin-bar.dev.js        2010-11-10 16:19:55 UTC (rev 16274)
</span><span class="lines">@@ -8,6 +8,9 @@
</span><span class="cx"> 
</span><span class="cx">         aB, hc = new RegExp('\\bhover\\b', 'g'), q = [],
</span><span class="cx"> 
</span><ins>+        /**
+         * Get the timeout ID of the given element
+         */
</ins><span class="cx">         getTOID = function(el) {
</span><span class="cx">                 var i = q.length;
</span><span class="cx">                 while( i-- )
</span><span class="lines">@@ -17,15 +20,34 @@
</span><span class="cx">         },
</span><span class="cx"> 
</span><span class="cx">         addClass = function(t) {
</span><ins>+                var ancestors = [],
+                ancestorLength = 0,
+                id,
+                i = q.length,
+                inA;
</ins><span class="cx">                 while ( t &amp;&amp; t != aB &amp;&amp; t != d ) {
</span><span class="cx">                         if( 'LI' == t.nodeName.toUpperCase() ) {
</span><del>-                                var id = getTOID(t);        
</del><ins>+                                ancestors[ ancestors.length ] = t;
+                                id = getTOID(t);        
</ins><span class="cx">                                 if ( id )
</span><span class="cx">                                         clearTimeout( id );
</span><span class="cx">                                 t.className = t.className ? ( t.className.replace(hc, '') + ' hover' ) : 'hover';
</span><span class="cx">                         }
</span><span class="cx">                         t = t.parentNode;
</span><span class="cx">                 }
</span><ins>+                
+                /* remove the hover class for any objects not in the immediate element's ancestry */
+                while ( i-- ) {
+                        inA = false;        
+                        ancestorLength = ancestors.length;
+                        while( ancestorLength-- ) {
+                                if ( ancestors[ ancestorLength ] == q[i][1] ) 
+                                        inA = true;        
+                        }
+
+                        if ( ! inA )
+                                q[i][1].className = q[i][1].className ? q[i][1].className.replace(hc, '') : '';
+                }
</ins><span class="cx">         },
</span><span class="cx"> 
</span><span class="cx">         removeClass = function(t) {
</span></span></pre></div>
<a id="trunkwpincludesjsadminbarjs"></a>
<div class="modfile"><h4>Modified: trunk/wp-includes/js/admin-bar.js (16273 => 16274)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-includes/js/admin-bar.js        2010-11-10 14:50:14 UTC (rev 16273)
+++ trunk/wp-includes/js/admin-bar.js        2010-11-10 16:19:55 UTC (rev 16274)
</span><span class="lines">@@ -1 +1 @@
</span><del>-(function(i,j){var c=function(m,l,d){if(m.addEventListener){m.addEventListener(l,d,false)}else{if(m.attachEvent){m.attachEvent(&quot;on&quot;+l,function(){return d.call(m,window.event)})}}},e,f=new RegExp(&quot;\\bhover\\b&quot;,&quot;g&quot;),a=[],g=function(l){var d=a.length;while(d--){if(a[d]&amp;&amp;l==a[d][1]){return a[d][0]}}return false},h=function(d){while(d&amp;&amp;d!=e&amp;&amp;d!=i){if(&quot;LI&quot;==d.nodeName.toUpperCase()){var l=g(d);if(l){clearTimeout(l)}d.className=d.className?(d.className.replace(f,&quot;&quot;)+&quot; hover&quot;):&quot;hover&quot;}d=d.parentNode}},k=function(d){while(d&amp;&amp;d!=e&amp;&amp;d!=i){if(&quot;LI&quot;==d.nodeName.toUpperCase()){(function(l){var m=setTimeout(function(){l.className=l.className?l.className.replace(f,&quot;&quot;):&quot;&quot;},500);a[a.length]=[m,l]})(d)}d=d.parentNode}},b=function(n){var m=n.target||n.srcElement,d,l;if(&quot;undefined&quot;==typeof adminBarL10n){return}while(m&amp;&amp;m!=e&amp;&amp;m!=i&amp;&amp;(!m.className||-1==m.className.indexOf(&quot;ab-get-shortlink&quot;))){m=m.parentNode}if(m&amp;&amp;m.className&amp;&amp;-1!=m.className.indexOf(&quot;ab-get-shortlink&quot;)){d=i.getElementsByTagName(&quot;link&quot;);if(!d.length){d=i.links}l=d.length;if(n.preventDefault){n.preventDefault()}n.returnValue=false;while(l--){if(d[l]&amp;&amp;&quot;shortlink&quot;==d[l].getAttribute(&quot;rel&quot;)){prompt(adminBarL10n.url,d[l].href);return false}}alert(adminBarL10n.noShortlink);return false}};c(j,&quot;load&quot;,function(){var d=i.getElementsByTagName(&quot;body&quot;)[0],l=i.getElementById(&quot;adminbar-search&quot;);e=i.getElementById(&quot;wpadminbar&quot;);if(d&amp;&amp;e){d.appendChild(e);c(e,&quot;mouseover&quot;,function(m){h(m.target||m.srcElement)});c(e,&quot;mouseout&quot;,function(m){k(m.target||m.srcElement)});c(e,&quot;click&quot;,b)}if(l){if(&quot;&quot;==l.value){l.value=l.getAttribute(&quot;title&quot;)}l.onblur=function(){this.value=&quot;&quot;==this.value?this.getAttribute(&quot;title&quot;):this.value};l.onfocus=function(){this.value=this.getAttribute(&quot;title&quot;)==this.value?&quot;&quot;:this.value}}if(j.location.hash){j.scrollBy(0,-32)}})})(document,window);
</del><span class="cx">\ No newline at end of file
</span><ins>+(function(i,j){var c=function(m,l,d){if(m.addEventListener){m.addEventListener(l,d,false)}else{if(m.attachEvent){m.attachEvent(&quot;on&quot;+l,function(){return d.call(m,window.event)})}}},e,f=new RegExp(&quot;\\bhover\\b&quot;,&quot;g&quot;),a=[],g=function(l){var d=a.length;while(d--){if(a[d]&amp;&amp;l==a[d][1]){return a[d][0]}}return false},h=function(l){var m=[],p=0,o,d=a.length,n;while(l&amp;&amp;l!=e&amp;&amp;l!=i){if(&quot;LI&quot;==l.nodeName.toUpperCase()){m[m.length]=l;o=g(l);if(o){clearTimeout(o)}l.className=l.className?(l.className.replace(f,&quot;&quot;)+&quot; hover&quot;):&quot;hover&quot;}l=l.parentNode}while(d--){n=false;p=m.length;while(p--){if(m[p]==a[d][1]){n=true}}if(!n){a[d][1].className=a[d][1].className?a[d][1].className.replace(f,&quot;&quot;):&quot;&quot;}}},k=function(d){while(d&amp;&amp;d!=e&amp;&amp;d!=i){if(&quot;LI&quot;==d.nodeName.toUpperCase()){(function(l){var m=setTimeout(function(){l.className=l.className?l.className.replace(f,&quot;&quot;):&quot;&quot;},500);a[a.length]=[m,l]})(d)}d=d.parentNode}},b=function(n){var m=n.target||n.srcElement,d,l;if(&quot;undefined&quot;==typeof adminBarL10n){return}while(m&amp;&amp;m!=e&amp;&amp;m!=i&amp;&amp;(!m.className||-1==m.className.indexOf(&quot;ab-get-shortlink&quot;))){m=m.parentNode}if(m&amp;&amp;m.className&amp;&amp;-1!=m.className.indexOf(&quot;ab-get-shortlink&quot;)){d=i.getElementsByTagName(&quot;link&quot;);if(!d.length){d=i.links}l=d.length;if(n.preventDefault){n.preventDefault()}n.returnValue=false;while(l--){if(d[l]&amp;&amp;&quot;shortlink&quot;==d[l].getAttribute(&quot;rel&quot;)){prompt(adminBarL10n.url,d[l].href);return false}}alert(adminBarL10n.noShortlink);return false}};c(j,&quot;load&quot;,function(){var d=i.getElementsByTagName(&quot;body&quot;)[0],l=i.getElementById(&quot;adminbar-search&quot;);e=i.getElementById(&quot;wpadminbar&quot;);if(d&amp;&amp;e){d.appendChild(e);c(e,&quot;mouseover&quot;,function(m){h(m.target||m.srcElement)});c(e,&quot;mouseout&quot;,function(m){k(m.target||m.srcElement)});c(e,&quot;click&quot;,b)}if(l){if(&quot;&quot;==l.value){l.value=l.getAttribute(&quot;title&quot;)}l.onblur=function(){this.value=&quot;&quot;==this.value?this.getAttribute(&quot;title&quot;):this.value};l.onfocus=function(){this.value=this.getAttribute(&quot;title&quot;)==this.value?&quot;&quot;:this.value}}if(j.location.hash){j.scrollBy(0,-32)}})})(document,window);
</ins><span class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="trunkwpincludesscriptloaderphp"></a>
<div class="modfile"><h4>Modified: trunk/wp-includes/script-loader.php (16273 => 16274)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-includes/script-loader.php        2010-11-10 14:50:14 UTC (rev 16273)
+++ trunk/wp-includes/script-loader.php        2010-11-10 16:19:55 UTC (rev 16274)
</span><span class="lines">@@ -499,7 +499,7 @@
</span><span class="cx">         $styles-&gt;add( 'nav-menu', &quot;/wp-admin/css/nav-menu$suffix.css&quot;, array(), '20100907' );
</span><span class="cx">         
</span><span class="cx">         // Admin bar
</span><del>-        $styles-&gt;add( 'admin-bar', &quot;/wp-includes/css/admin-bar$suffix.css&quot;, array(), '20101029' );
</del><ins>+        $styles-&gt;add( 'admin-bar', &quot;/wp-includes/css/admin-bar$suffix.css&quot;, array(), '20101110' );
</ins><span class="cx"> 
</span><span class="cx">         foreach ( $rtl_styles as $rtl_style ) {
</span><span class="cx">                 $styles-&gt;add_data( $rtl_style, 'rtl', true );
</span></span></pre>
</div>
</div>

</body>
</html>