Toolbar: Allow submenus to be closed with a second tap on touch devices.

Also closes submenus when the admin menu is toggled open, as it opens below and thus can be obscured.

props stephdau, seanchayes.
see #29906.


git-svn-id: https://develop.svn.wordpress.org/trunk@33056 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Helen Hou-Sandi
2015-07-03 03:28:15 +00:00
parent e709e91218
commit e7a184a832
4 changed files with 34 additions and 5 deletions
+4
View File
@@ -920,6 +920,10 @@ li#wp-admin-bar-menu-toggle {
-moz-box-sizing: border-box;
box-sizing: border-box;
}
.wp-responsive-open #wpadminbar #wp-admin-bar-menu-toggle .ab-icon:before {
color: #00b9eb;
}
}
/* Smartphone */
+4
View File
@@ -752,6 +752,10 @@ $(document).ready( function() {
// Toggle sidebar when toggle is clicked
$( '#wp-admin-bar-menu-toggle' ).on( 'click.wp-responsive', function( event ) {
event.preventDefault();
// close any open toolbar submenus
$adminbar.find( '.hover' ).removeClass( 'hover' );
$wpwrap.toggleClass( 'wp-responsive-open' );
if ( $wpwrap.hasClass( 'wp-responsive-open' ) ) {
$(this).find('a').attr( 'aria-expanded', 'true' );