Making WordPress.org

Changeset 5875


Ignore:
Timestamp:
09/04/2017 03:03:14 PM (8 years ago)
Author:
SergeyBiryukov
Message:

Breathe: Properly set the .active class and aria-expanded attribute for the current menu item in handbook Chapters menu.

Fixes #3048.

Location:
sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-breathe
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-breathe/functions.php

    r5871 r5875  
    4747
    4848    // Cacheing hack
    49     wp_enqueue_style( 'wporg-breathe', get_stylesheet_uri(), array( 'p2-breathe' ), '20170904' );
     49    wp_enqueue_style( 'wporg-breathe', get_stylesheet_uri(), array( 'p2-breathe' ), '20170904a' );
    5050}
    5151add_action( 'wp_enqueue_scripts', __NAMESPACE__ . '\styles', 11 );
  • sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-breathe/js/chapters.js

    r5871 r5875  
    1111
    1212    // Open the current menu
    13     jQuery( '.current-menu-item a' ).first()
     13    jQuery( '.menu-table-of-contents-container .current-menu-item a' ).first()
    1414        .addClass( 'active' )
    1515        .parents( '.menu-item-has-children' )
    16             .toggleClass( 'open' );
     16            .toggleClass( 'open' )
     17        .find( '> div > .dashicons' )
     18            .attr( 'aria-expanded', true );
    1719
    1820    // Or if wrapped in a div.expandable
     
    2325
    2426        menuToggle.toggleClass( 'open' );
    25         menuToggle.attr( 'aria-expanded', menuToggle.hasClass( 'open' ) );
     27        jQuery( this ).attr( 'aria-expanded', menuToggle.hasClass( 'open' ) );
    2628    } );
    2729} );
Note: See TracChangeset for help on using the changeset viewer.