Admin bar shortlink improvements. props koopersmith, fixes #16155.

git-svn-id: https://develop.svn.wordpress.org/trunk@17265 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Andrew Nacin
2011-01-12 00:32:00 +00:00
parent 84e50d906f
commit 85ec22211e
5 changed files with 20 additions and 15 deletions

View File

@@ -38,13 +38,15 @@
}
// Remove any selected classes.
ul = hovering.parentNode;
if ( ul && 'UL' == ul.nodeName.toUpperCase() ) {
i = ul.childNodes.length;
while ( i-- ) {
li = ul.childNodes[i];
if ( li != hovering )
li.className = li.className ? li.className.replace( rselected, '' ) : '';
if ( hovering ) {
ul = hovering.parentNode;
if ( ul && 'UL' == ul.nodeName.toUpperCase() ) {
i = ul.childNodes.length;
while ( i-- ) {
li = ul.childNodes[i];
if ( li != hovering )
li.className = li.className ? li.className.replace( rselected, '' ) : '';
}
}
}
@@ -78,15 +80,14 @@
},
clickShortlink = function(e) {
var i, l, node, className,
t = e.target || e.srcElement,
shortlink = t.href;
var i, l, node,
t = e.target || e.srcElement;
// Make t the shortlink menu item, or return.
while ( true ) {
// Check if we've gone past the shortlink node,
// or if the user is clicking on the input.
if ( ! t || t == d || t == aB || -1 != t.className.indexOf('shortlink-input') )
if ( ! t || t == d || t == aB )
return;
// Check if we've found the shortlink node.
if ( t.className && -1 != t.className.indexOf('ab-get-shortlink') )