WordPress.org

Make WordPress Core

Ticket #39026: 39026.1.patch

File 39026.1.patch, 1.1 KB (added by laurelfulford, 3 years ago)
  • src/wp-content/themes/twentyseventeen/assets/js/navigation.js

     
    1818                container.find( '.menu-item-has-children > a, .page_item_has_children > a' ).after( dropdownToggle );
    1919
    2020                // Toggle buttons and submenu items with active children menu items.
    21                 container.find( '.current-menu-ancestor > button' ).addClass( 'toggled-on' );
     21                container.find( '.current-menu-ancestor > button' ).addClass( 'toggled-on' ).attr( 'aria-expanded', 'true' );
    2222                container.find( '.current-menu-ancestor > .sub-menu' ).addClass( 'toggled-on' );
    2323
     24                // Update screen reader text for buttons with active children menu items.
     25                container.find( '.current-menu-ancestor > button .screen-reader-text' ).text( twentyseventeenScreenReaderText.collapse );
     26
    2427                container.find( '.dropdown-toggle' ).click( function( e ) {
    2528                        var _this = $( this ),
    2629                                screenReaderSpan = _this.find( '.screen-reader-text' );