Improve keyboard accessibility for the admin menu when in responsive mode, props SergeyBiryukov, fixes #26639 for trunk.
Built from https://develop.svn.wordpress.org/trunk@27011 git-svn-id: http://core.svn.wordpress.org/trunk@26888 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
c64266f38f
commit
33c41db77a
|
@ -11828,19 +11828,13 @@ li#wp-admin-bar-menu-toggle {
|
|||
.auto-fold #adminmenuback,
|
||||
.auto-fold #adminmenuwrap {
|
||||
position: absolute;
|
||||
right: 0;
|
||||
width: 190px;
|
||||
z-index: 100;
|
||||
}
|
||||
|
||||
.auto-fold #adminmenuback,
|
||||
.auto-fold #adminmenuwrap {
|
||||
right: -200px;
|
||||
}
|
||||
|
||||
.auto-fold #adminmenuwrap,
|
||||
.auto-fold #adminmenu,
|
||||
.auto-fold #adminmenuback {
|
||||
width: 190px;
|
||||
display: none;
|
||||
}
|
||||
|
||||
.auto-fold #adminmenu li.menu-top {
|
||||
|
@ -11946,7 +11940,7 @@ li#wp-admin-bar-menu-toggle {
|
|||
|
||||
.auto-fold .wp-responsive-open #adminmenuback,
|
||||
.auto-fold .wp-responsive-open #adminmenuwrap {
|
||||
right: 0;
|
||||
display: block;
|
||||
}
|
||||
|
||||
/* General New Post Form */
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -11828,19 +11828,13 @@ li#wp-admin-bar-menu-toggle {
|
|||
.auto-fold #adminmenuback,
|
||||
.auto-fold #adminmenuwrap {
|
||||
position: absolute;
|
||||
left: 0;
|
||||
width: 190px;
|
||||
z-index: 100;
|
||||
}
|
||||
|
||||
.auto-fold #adminmenuback,
|
||||
.auto-fold #adminmenuwrap {
|
||||
left: -200px;
|
||||
}
|
||||
|
||||
.auto-fold #adminmenuwrap,
|
||||
.auto-fold #adminmenu,
|
||||
.auto-fold #adminmenuback {
|
||||
width: 190px;
|
||||
display: none;
|
||||
}
|
||||
|
||||
.auto-fold #adminmenu li.menu-top {
|
||||
|
@ -11946,7 +11940,7 @@ li#wp-admin-bar-menu-toggle {
|
|||
|
||||
.auto-fold .wp-responsive-open #adminmenuback,
|
||||
.auto-fold .wp-responsive-open #adminmenuwrap {
|
||||
left: 0;
|
||||
display: block;
|
||||
}
|
||||
|
||||
/* General New Post Form */
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -560,10 +560,18 @@ $(document).ready( function() {
|
|||
self.deactivate();
|
||||
});
|
||||
|
||||
$( '#wp-admin-bar-menu-toggle a' ).attr( 'aria-expanded', 'false' );
|
||||
|
||||
// Toggle sidebar when toggle is clicked
|
||||
$( '#wp-admin-bar-menu-toggle' ).on( 'click.wp-responsive', function( event ) {
|
||||
event.preventDefault();
|
||||
$wpwrap.toggleClass( 'wp-responsive-open' );
|
||||
if ( $wpwrap.hasClass( 'wp-responsive-open' ) ) {
|
||||
$(this).find('a').attr( 'aria-expanded', 'true' );
|
||||
$( '#adminmenu a:first' ).focus();
|
||||
} else {
|
||||
$(this).find('a').attr( 'aria-expanded', 'false' );
|
||||
}
|
||||
} );
|
||||
|
||||
// Add menu events
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -166,11 +166,8 @@ function wp_admin_bar_sidebar_toggle( $wp_admin_bar ) {
|
|||
if ( is_admin() ) {
|
||||
$wp_admin_bar->add_menu( array(
|
||||
'id' => 'menu-toggle',
|
||||
'title' => '<span class="ab-icon"></span>',
|
||||
'title' => '<span class="ab-icon"></span><span class="screen-reader-text">' . __( 'Menu' ) . '</span>',
|
||||
'href' => '#',
|
||||
'meta' => array(
|
||||
'title' => __( 'Menu' ),
|
||||
),
|
||||
) );
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue