Add unique ids as well as of classes in the admin bar to make it easier for plugins to extend.

Ensure we escape the classname.
Fixes #16211 props koopersmith.

git-svn-id: http://svn.automattic.com/wordpress/trunk@17279 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
westi
2011-01-13 01:34:15 +00:00
parent d1c2b06a7e
commit 2a75d9c511
5 changed files with 21 additions and 18 deletions

View File

@@ -90,15 +90,16 @@
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') )
if ( t.id && t.id == 'wp-admin-bar-get-shortlink' )
break;
t = t.parentNode;
}
// IE doesn't support preventDefault, and does support returnValue
if ( e.preventDefault )
e.preventDefault();
e.returnValue = false;
if ( -1 == t.className.indexOf('selected') )
t.className += ' selected';