From c5dde9202344c40e6f770e129071a37454df5ebf Mon Sep 17 00:00:00 2001 From: Corwin Perren Date: Fri, 7 Nov 2025 19:50:46 -0800 Subject: [PATCH] Made event handlers attach after page load --- src/components/CustomCarousel.astro | 2 +- src/components/Timeline.astro | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/components/CustomCarousel.astro b/src/components/CustomCarousel.astro index dd73dd1..5a7f8ab 100644 --- a/src/components/CustomCarousel.astro +++ b/src/components/CustomCarousel.astro @@ -112,7 +112,7 @@ const limitByWidthClasses = "max-h-fit"; if (this._slide && this._items.length > 0) this._carousel.cycle(); - this._attachHandlers() + window.addEventListener("load", this._attachHandlers); } diff --git a/src/components/Timeline.astro b/src/components/Timeline.astro index 1fb369a..43a80b3 100644 --- a/src/components/Timeline.astro +++ b/src/components/Timeline.astro @@ -39,7 +39,9 @@ const timeline: timelineEntry[] = Astro.props.timeline || []; constructor() { super(); this._eventElements = this._getNodeElements(); - this._paintLeaderLines(); + + + window.addEventListener("load", this._paintLeaderLines); }