diff --git a/src/routes/stops/[stopID]/schedule/+page.svelte b/src/routes/stops/[stopID]/schedule/+page.svelte index 627f2b2..fa4e913 100644 --- a/src/routes/stops/[stopID]/schedule/+page.svelte +++ b/src/routes/stops/[stopID]/schedule/+page.svelte @@ -21,6 +21,7 @@ let stopDirection = $state(''); let loading = $state(true); let accordionComponent = $state(); + let allRoutesExpanded = $state(false); let schedulesMap = new Map(); let routeReference = new Map(); @@ -105,6 +106,15 @@ return grouped; } + function toggleAllRoutes() { + if (allRoutesExpanded) { + accordionComponent.closeAll(); + } else { + accordionComponent.openAll(); + } + allRoutesExpanded = !allRoutesExpanded; + } + onMount(async () => { const formattedDate = currentDate.toISOString().split('T')[0]; await fetchScheduleForStop(stopId, formattedDate); @@ -148,11 +158,10 @@
- -