=== '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; } } })(); h this doc set⌘K'; document.querySelector('.rm-Header-bottom .rm-Container')?.insertAdjacentHTML('beforeend', searchHtml); } })();