From 58e8e1820d380cd5e1318d321e21192a2a59d7d6 Mon Sep 17 00:00:00 2001 From: deepench Date: Fri, 25 Sep 2026 10:50:00 +0100 Subject: [PATCH] Fix - Submenu caret icon never flips direction when toggled The sub-toggle click handler looked for a child matching ".sub-toggle .fa", but inside the handler `this` already is the .sub-toggle element itself, not a container of one - so the selector never matched anything and toggleClass() silently ran on an empty set. The submenu itself opened and closed correctly (a separate call), only the caret's own direction (caret-right/caret-down) never updated. Fixed by matching the icon's actual direct child selector, ".fa". Verified live in both themes: before the fix, clicking the caret expanded the submenu but the icon class never changed; after, it flips fa-caret-right <-> fa-caret-down correctly in both directions. Also checked and ruled out a previously-suspected duplicate id="site-navigation" theory: header.php's two spacious_main_nav() call sites are wrapped in genuinely mutually exclusive conditions (spacious_header_display_type === 'four' vs !== 'four'), so only one nav ever renders - confirmed with 0 duplicates under both settings, live. Nothing to fix there. --- js/spacious-custom.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/js/spacious-custom.js b/js/spacious-custom.js index 1b66091..230bccd 100644 --- a/js/spacious-custom.js +++ b/js/spacious-custom.js @@ -24,7 +24,7 @@ jQuery( document ).ready( function () { jQuery('.better-responsive-menu .menu-primary-container .sub-toggle').click(function() { jQuery(this).parent('.menu-item-has-children').children('ul.sub-menu').first().slideToggle('1000'); - jQuery(this).children('.sub-toggle .fa').first().toggleClass('fa-caret-down fa-caret-right'); + jQuery(this).children('.fa').first().toggleClass('fa-caret-down fa-caret-right'); }); /**