diff --git a/src/components/Bedarfsausweis/BedarfsausweisContent1.svelte b/src/components/Bedarfsausweis/BedarfsausweisContent1.svelte index 4606109d..0f20e816 100644 --- a/src/components/Bedarfsausweis/BedarfsausweisContent1.svelte +++ b/src/components/Bedarfsausweis/BedarfsausweisContent1.svelte @@ -104,6 +104,27 @@ ausweis.anteil_zusatzheizung = 0.7; ausweis = ausweis; } + + function toggleSection(section: HTMLElement): void { + // Find the next sibling element and assert it's an HTMLElement + const formContainer = section.nextElementSibling as HTMLElement | null; + if (!formContainer) { + console.error("Form container not found."); + return; + } + + // Find the icon inside the section and assert it's an HTMLElement + const icon = section.querySelector('.toggle-icon') as HTMLElement | null; + if (!icon) { + console.error("Toggle icon not found."); + return; + } + + // Toggle classes for expanded and collapsed states + formContainer.classList.toggle('expanded'); + section.classList.toggle('collapsed'); +} +