Changelog

-expanded'); } else { parentLi.classList.add('subnav-expanded'); } } }); // Also handle clicking the parent link text itself (the containing the button) document.addEventListener('click', function (e) { var link = e.target.closest('a.Sidebar-link_parent'); if (!link) return; // Only intercept if we clicked the link area, not the button itself if (e.target.closest('[aria-expanded]')) return; // Expand the sub-nav, then navigate to the parent page var btn = link.querySelector('[aria-expanded]'); if (btn) { var expanded = btn.getAttribute('aria-expanded') === 'true'; if (!expanded) { btn.setAttribute('aria-expanded', 'true'); var label = btn.getAttribute('aria-label') || ''; btn.setAttribute('aria-label', label.replace('Show subpages', 'Hide subpages')); var parentLi = btn.closest('.Sidebar-item23D-2Kd61_k3'); if (parentLi) { parentLi.classList.add('subnav-expanded'); } } } // Let the default anchor navigation proceed (do NOT preventDefault) }); // Auto-expand the active page's parent section on page load var activeSidebarLink = document.querySelector('.rm-Sidebar-link.active, a[aria-current="page"]'); if (activeSidebarLink) { // Walk up and expand all parent sections var el = activeSidebarLink.closest('.Sidebar-item23D-2Kd61_k3'); while (el) { var parentUl = el.parentElement; if (parentUl && parentUl.classList.contains('subpages')) { // Find the parent
  • that owns this subpages list var parentLi = parentUl.closest('.Sidebar-item23D-2Kd61_k3'); if (parentLi) { parentLi.classList.add('subnav-expanded'); var toggleBtn = parentLi.querySelector('[aria-expanded]'); if (toggleBtn) { toggleBtn.setAttribute('aria-expanded', 'true'); var lbl = toggleBtn.getAttribute('aria-label') || ''; toggleBtn.setAttribute('aria-label', lbl.replace('Show subpages', 'Hide subpages')); } } } el = parentUl && parentUl.closest('.Sidebar-item23D-2Kd61_k3'); if (el === activeSidebarLink.closest('.Sidebar-item23D-2Kd61_k3')) break; } } })();