From ce431364a08283f4a1462c178de1df7033244b0e Mon Sep 17 00:00:00 2001 From: Jake/Rads Date: Mon, 27 Jun 2022 13:09:13 +0200 Subject: [PATCH] fix(dashboard): reuse list component in randomizer --- dashboard/src/lib/list/CardsList.svelte | 8 +-- dashboard/src/pages/Random.svelte | 83 +------------------------ 2 files changed, 6 insertions(+), 85 deletions(-) diff --git a/dashboard/src/lib/list/CardsList.svelte b/dashboard/src/lib/list/CardsList.svelte index 4b51732f..7bbf14af 100644 --- a/dashboard/src/lib/list/CardsList.svelte +++ b/dashboard/src/lib/list/CardsList.svelte @@ -20,6 +20,8 @@ export let isPublic: boolean; export let itemType: string; export let isMainDash: boolean; + + export let openByDefault = false; let cardIndexArray = []; @@ -61,10 +63,8 @@ function toggleCard(index: number) { if (isOpenArray[index] === true) { isOpenArray[index] = false; - cardIndexArray[index].classList.add("collapsed"); } else { isOpenArray[index] = true; - cardIndexArray[index].classList.remove("collapsed"); } } @@ -101,7 +101,7 @@ } -{#if settings && settings.accessibility ? (!settings.accessibility.expandedcards && !settings.accessibility.pagelinks) : true} +{#if !openByDefault && (settings && settings.accessibility ? (!settings.accessibility.expandedcards && !settings.accessibility.pagelinks) : true)}
{#each list as item, index (item.id + index)} @@ -135,7 +135,7 @@ {/each}
-{:else if settings.accessibility.expandedcards} +{:else if openByDefault || settings.accessibility.expandedcards} {#each list as item, index (item.id + index)}