Make WordPress Core

Ticket #30722: 30722.2.diff

File 30722.2.diff, 849 bytes (added by jartes, 11 years ago)
  • src/wp-content/themes/twentyfifteen/js/functions.js

     
    1313        // Add dropdown toggle that display child menu items.
    1414        $( '.main-navigation .menu-item-has-children > a' ).after( '<button class="dropdown-toggle" aria-expanded="false">' + screenReaderText.expand + '</button>' );
    1515
     16        // Toggle buttons and submenu items with active children menu items
     17        $( '.main-navigation .current-menu-ancestor > button' ).addClass( 'toggle-on' );
     18        $( '.main-navigation .current-menu-ancestor > .sub-menu' ).addClass( 'toggled-on' );
     19
    1620        $( '.dropdown-toggle' ).click( function( e ) {
    1721                var _this = $( this );
    1822                e.preventDefault();