Ticket #15307: admin-bar-hover-fixes.15307.diff
File admin-bar-hover-fixes.15307.diff, 1.3 KB (added by , 10 years ago) |
---|
-
wp-includes/js/admin-bar.dev.js
8 8 9 9 aB, hc = new RegExp('\\bhover\\b', 'g'), q = [], 10 10 11 /** 12 * Get the timeout ID of the given element 13 */ 11 14 getTOID = function(el) { 12 15 var i = q.length; 13 16 while( i-- ) … … 17 20 }, 18 21 19 22 addClass = function(t) { 23 var ancestors = [], 24 ancestorLength = 0, 25 id, 26 i = q.length, 27 inA; 20 28 while ( t && t != aB && t != d ) { 21 29 if( 'LI' == t.nodeName.toUpperCase() ) { 22 var id = getTOID(t); 30 ancestors[ ancestors.length ] = t; 31 id = getTOID(t); 23 32 if ( id ) 24 33 clearTimeout( id ); 25 34 t.className = t.className ? ( t.className.replace(hc, '') + ' hover' ) : 'hover'; 26 35 } 27 36 t = t.parentNode; 28 37 } 38 39 /* remove the hover class for any objects not in the immediate element's ancestry */ 40 while ( i-- ) { 41 inA = false; 42 ancestorLength = ancestors.length; 43 while( ancestorLength-- ) { 44 if ( ancestors[ ancestorLength ] == q[i][1] ) 45 inA = true; 46 } 47 48 if ( ! inA ) 49 q[i][1].className = q[i][1].className ? q[i][1].className.replace(hc, '') : ''; 50 } 29 51 }, 30 52 31 53 removeClass = function(t) {