Twenty Fifteen: keep sub-menus open when visiting sub-menu pages, to show context when navigating a site.
Props jartes, fixes #30722. git-svn-id: https://develop.svn.wordpress.org/trunk@31214 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
d29abb1d24
commit
19b4a0053a
@ -13,6 +13,10 @@
|
|||||||
// Add dropdown toggle that display child menu items.
|
// Add dropdown toggle that display child menu items.
|
||||||
$( '.main-navigation .menu-item-has-children > a' ).after( '<button class="dropdown-toggle" aria-expanded="false">' + screenReaderText.expand + '</button>' );
|
$( '.main-navigation .menu-item-has-children > a' ).after( '<button class="dropdown-toggle" aria-expanded="false">' + screenReaderText.expand + '</button>' );
|
||||||
|
|
||||||
|
// Toggle buttons and submenu items with active children menu items.
|
||||||
|
$( '.main-navigation .current-menu-ancestor > button' ).addClass( 'toggle-on' );
|
||||||
|
$( '.main-navigation .current-menu-ancestor > .sub-menu' ).addClass( 'toggled-on' );
|
||||||
|
|
||||||
$( '.dropdown-toggle' ).click( function( e ) {
|
$( '.dropdown-toggle' ).click( function( e ) {
|
||||||
var _this = $( this );
|
var _this = $( this );
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
|
Loading…
Reference in New Issue
Block a user