Toolbar: Restore scroll-to-top functionality.

H/t Ipstenu.
Introduced in [33056].

See #29906.



git-svn-id: https://develop.svn.wordpress.org/trunk@33334 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Konstantin Obenland 2015-07-20 20:01:34 +00:00
parent b480968d9b
commit 8ea9ecdeb1

View File

@ -129,17 +129,14 @@ if ( typeof(jQuery) != 'undefined' ) {
target.siblings('.ab-sub-wrapper').find('.ab-item').each(refresh);
});
$('#wpadminbar').click( function(e) {
adminbar.click( function(e) {
if ( e.target.id != 'wpadminbar' && e.target.id != 'wp-admin-bar-top-secondary' ) {
return;
} else {
adminbar.find( 'li.menupop.hover' ).removeClass( 'hover' );
e.stopPropagation();
return;
}
adminbar.find( 'li.menupop.hover' ).removeClass( 'hover' );
$( 'html, body' ).animate( { scrollTop: 0 }, 'fast' );
e.preventDefault();
$('html, body').animate({ scrollTop: 0 }, 'fast');
});
// fix focus bug in WebKit