Make WordPress Core

Changeset 32971


Ignore:
Timestamp:
06/27/2015 10:04:32 AM (9 years ago)
Author:
ocean90
Message:

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

props afercia.
fixes #32791.

Location:
trunk/src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/js/customize-nav-menus.js

    r32955 r32971  
    856856            if ( expanded ) {
    857857                button.addClass( 'open' );
     858                button.attr( 'aria-expanded', 'true' );
    858859                content.slideDown( 'fast', function() {
    859860                    customizer.scrollTop( customizer.height() );
     
    861862            } else {
    862863                button.removeClass( 'open' );
     864                button.attr( 'aria-expanded', 'false' );
    863865                content.slideUp( 'fast' );
    864866            }
  • trunk/src/wp-includes/class-wp-customize-section.php

    r32965 r32971  
    563563        ?>
    564564        <li id="accordion-section-<?php echo esc_attr( $this->id ); ?>" class="accordion-section-new-menu">
    565             <button type="button" class="button-secondary add-new-menu-item add-menu-toggle">
     565            <button type="button" class="button-secondary add-new-menu-item add-menu-toggle" aria-expanded="false">
    566566                <?php echo esc_html( $this->title ); ?>
    567                 <span class="screen-reader-text"><?php _e( 'Press return or enter to open' ); ?></span>
    568567            </button>
    569568            <ul class="new-menu-section-content"></ul>
Note: See TracChangeset for help on using the changeset viewer.