Improve keyboard accessibility for the admin menu when in responsive mode, props SergeyBiryukov, fixes #26639 for 3.8.1.

Built from https://develop.svn.wordpress.org/branches/3.8@27010


git-svn-id: http://core.svn.wordpress.org/branches/3.8@26887 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Andrew Ozz 2014-01-22 20:03:11 +00:00
parent 709b498b20
commit 01057aaa58
7 changed files with 18 additions and 25 deletions

View File

@ -11851,19 +11851,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 {
@ -11969,7 +11963,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

View File

@ -11851,19 +11851,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 {
@ -11969,7 +11963,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

View File

@ -553,10 +553,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

View File

@ -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' ),
),
) );
}
}