Customizer: Add an aria-expanded attribute to the Add Menu button to improve accessibility.

props afercia.
fixes #32791.
Built from https://develop.svn.wordpress.org/trunk@32971


git-svn-id: http://core.svn.wordpress.org/trunk@32942 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Dominik Schilling 2015-06-27 10:05:24 +00:00
parent 2d9a46b973
commit 2ecb586214
4 changed files with 6 additions and 5 deletions

View File

@ -855,11 +855,13 @@
customizer = section.container.closest( '.wp-full-overlay-sidebar-content' );
if ( expanded ) {
button.addClass( 'open' );
button.attr( 'aria-expanded', 'true' );
content.slideDown( 'fast', function() {
customizer.scrollTop( customizer.height() );
});
} else {
button.removeClass( 'open' );
button.attr( 'aria-expanded', 'false' );
content.slideUp( 'fast' );
}
}

File diff suppressed because one or more lines are too long

View File

@ -562,9 +562,8 @@ class WP_Customize_New_Menu_Section extends WP_Customize_Section {
protected function render() {
?>
<li id="accordion-section-<?php echo esc_attr( $this->id ); ?>" class="accordion-section-new-menu">
<button type="button" class="button-secondary add-new-menu-item add-menu-toggle">
<button type="button" class="button-secondary add-new-menu-item add-menu-toggle" aria-expanded="false">
<?php echo esc_html( $this->title ); ?>
<span class="screen-reader-text"><?php _e( 'Press return or enter to open' ); ?></span>
</button>
<ul class="new-menu-section-content"></ul>
</li>

View File

@ -4,7 +4,7 @@
*
* @global string $wp_version
*/
$wp_version = '4.3-alpha-32970';
$wp_version = '4.3-alpha-32971';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.