Make WordPress Core

Changeset 31214


Ignore:
Timestamp:
01/16/2015 07:16:56 PM (11 years ago)
Author:
lancewillett
Message:

Twenty Fifteen: keep sub-menus open when visiting sub-menu pages, to show context when navigating a site.

Props jartes, fixes #30722.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-content/themes/twentyfifteen/js/functions.js

    r31183 r31214  
    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>' );
     15
     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' );
    1519
    1620    $( '.dropdown-toggle' ).click( function( e ) {
Note: See TracChangeset for help on using the changeset viewer.