mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-09-25 10:20:22 +00:00
Admin bar hover fixes. Props filosofo. see #15307
git-svn-id: https://develop.svn.wordpress.org/trunk@16274 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -8,6 +8,9 @@
|
||||
|
||||
aB, hc = new RegExp('\\bhover\\b', 'g'), q = [],
|
||||
|
||||
/**
|
||||
* Get the timeout ID of the given element
|
||||
*/
|
||||
getTOID = function(el) {
|
||||
var i = q.length;
|
||||
while( i-- )
|
||||
@@ -17,15 +20,34 @@
|
||||
},
|
||||
|
||||
addClass = function(t) {
|
||||
var ancestors = [],
|
||||
ancestorLength = 0,
|
||||
id,
|
||||
i = q.length,
|
||||
inA;
|
||||
while ( t && t != aB && t != d ) {
|
||||
if( 'LI' == t.nodeName.toUpperCase() ) {
|
||||
var id = getTOID(t);
|
||||
ancestors[ ancestors.length ] = t;
|
||||
id = getTOID(t);
|
||||
if ( id )
|
||||
clearTimeout( id );
|
||||
t.className = t.className ? ( t.className.replace(hc, '') + ' hover' ) : 'hover';
|
||||
}
|
||||
t = t.parentNode;
|
||||
}
|
||||
|
||||
/* 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, '') : '';
|
||||
}
|
||||
},
|
||||
|
||||
removeClass = function(t) {
|
||||
|
||||
Reference in New Issue
Block a user