From bd17b39fd2c63751ca8f0fdfa8f7bbdf13efd9eb Mon Sep 17 00:00:00 2001 From: saicaca Date: Mon, 12 Feb 2024 01:10:04 +0800 Subject: [PATCH] fix: fix widget content collapsing not working --- src/components/widget/Categories.astro | 2 +- src/components/widget/Tags.astro | 2 +- src/components/widget/WidgetLayout.astro | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/components/widget/Categories.astro b/src/components/widget/Categories.astro index 98d2eb8..dabb771 100644 --- a/src/components/widget/Categories.astro +++ b/src/components/widget/Categories.astro @@ -9,7 +9,7 @@ import ButtonLink from "../control/ButtonLink.astro"; const categories = await getCategoryList(); -const COLLAPSED_HEIGHT = "120px"; +const COLLAPSED_HEIGHT = "7.5rem"; const COLLAPSE_THRESHOLD = 5; const isCollapsed = categories.length >= COLLAPSE_THRESHOLD; diff --git a/src/components/widget/Tags.astro b/src/components/widget/Tags.astro index 1ad59c1..2bbcc49 100644 --- a/src/components/widget/Tags.astro +++ b/src/components/widget/Tags.astro @@ -8,7 +8,7 @@ import I18nKey from "../../i18n/i18nKey"; const tags = await getTagList(); -const COLLAPSED_HEIGHT = "120px"; +const COLLAPSED_HEIGHT = "7.5rem"; const isCollapsed = tags.length >= 20; diff --git a/src/components/widget/WidgetLayout.astro b/src/components/widget/WidgetLayout.astro index f1c3348..4ce7fd3 100644 --- a/src/components/widget/WidgetLayout.astro +++ b/src/components/widget/WidgetLayout.astro @@ -18,7 +18,7 @@ const { } = Astro.props --- - +
{name}
@@ -45,7 +45,7 @@ const { constructor() { super(); - if (!this.dataset.isCollapsed) + if (this.dataset.isCollapsed === undefined || this.dataset.isCollapsed === false) return; const id = this.dataset.id;