(hdr, cnt)
| 5672 | } |
| 5673 | |
| 5674 | function scheduleSectionFocus(hdr, cnt) { |
| 5675 | if (!hdr || !cnt) return; |
| 5676 | clearSectionTimer(cnt); |
| 5677 | const focusNow = () => { |
| 5678 | if (cnt.style.display === "none") return; |
| 5679 | focusSectionIntoView(hdr, cnt); |
| 5680 | }; |
| 5681 | requestAnimationFrame(() => { |
| 5682 | requestAnimationFrame(() => { |
| 5683 | focusNow(); |
| 5684 | cnt.__focusTimer = setTimeout(() => { |
| 5685 | if (cnt.classList.contains("is-open") && cnt.style.display !== "none") { |
| 5686 | focusSectionIntoView(hdr, cnt); |
| 5687 | } |
| 5688 | cnt.__focusTimer = null; |
| 5689 | }, SECTION_ANIM_MS + 40); |
| 5690 | }); |
| 5691 | }); |
| 5692 | } |
| 5693 | |
| 5694 | function toggleSection(id) { |
| 5695 | const hdr = document.getElementById(id + "Header"); |
no test coverage detected