e.stopPropagation();
e.preventDefault();
el.addClass('hover');
+ } else if ( ! $( e.target ).closest( 'div' ).hasClass( 'ab-sub-wrapper' ) ) {
+ // We're dealing with an already-touch-opened menu genericon (we know el.hasClass('hover')),
+ // so close it on a second tap and prevent propag and defaults. See #29906
+ e.stopPropagation();
+ e.preventDefault();
+ el.removeClass('hover');
}
if ( unbind ) {
target.siblings('.ab-sub-wrapper').find('.ab-item').each(refresh);
});
- $('#wpadminbar').click( function(e) {
- if ( e.target.id != 'wpadminbar' && e.target.id != 'wp-admin-bar-top-secondary' )
+ adminbar.click( function(e) {
+ if ( e.target.id != 'wpadminbar' && e.target.id != 'wp-admin-bar-top-secondary' ) {
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