From 8ea9ecdeb111adb4386e366c46c2dcfaa627697b Mon Sep 17 00:00:00 2001 From: Konstantin Obenland Date: Mon, 20 Jul 2015 20:01:34 +0000 Subject: [PATCH] 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 --- src/wp-includes/js/admin-bar.js | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/src/wp-includes/js/admin-bar.js b/src/wp-includes/js/admin-bar.js index 9142246d06..10d2954781 100644 --- a/src/wp-includes/js/admin-bar.js +++ b/src/wp-includes/js/admin-bar.js @@ -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