From 19b4a0053afe1570907d62663cd6854e05846bf5 Mon Sep 17 00:00:00 2001 From: Lance Willett Date: Fri, 16 Jan 2015 19:16:56 +0000 Subject: [PATCH] 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 --- src/wp-content/themes/twentyfifteen/js/functions.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/wp-content/themes/twentyfifteen/js/functions.js b/src/wp-content/themes/twentyfifteen/js/functions.js index eb4f8fa6d9..c530e42c28 100644 --- a/src/wp-content/themes/twentyfifteen/js/functions.js +++ b/src/wp-content/themes/twentyfifteen/js/functions.js @@ -13,6 +13,10 @@ // Add dropdown toggle that display child menu items. $( '.main-navigation .menu-item-has-children > a' ).after( '' ); + // 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 ) { var _this = $( this ); e.preventDefault();