Don't render expandable content unless expanded

This commit is contained in:
2023-10-11 19:47:47 +02:00
parent 942f7c7888
commit 5bd26ce5bc

View File

@@ -43,15 +43,17 @@ export let highlight = false
<button class="bucket_expand" on:click|stopPropagation={toggle}> <button class="bucket_expand" on:click|stopPropagation={toggle}>
{#if expanded} {#if expanded}
<i class="icon">expand_less</i> <i class="icon">expand_less</i>
{:else} {:else}
<i class="icon">expand_more</i> <i class="icon">expand_more</i>
{/if} {/if}
</button> </button>
</div> </div>
<div class="body" class:hidden={!expanded}> {#if expanded}
<slot></slot> <div class="body">
</div> <slot></slot>
</div>
{/if}
</div> </div>
<style> <style>
@@ -90,7 +92,4 @@ export let highlight = false
text-decoration: none; text-decoration: none;
border-top: 1px solid var(--separator); border-top: 1px solid var(--separator);
} }
.hidden {
display: none;
}
</style> </style>