working on loading items for location

This commit is contained in:
2025-10-13 21:57:50 +02:00
parent 26d2f7c1f4
commit 6e9a2b6aca
10 changed files with 152 additions and 9 deletions

View File

@@ -3,11 +3,12 @@
import { error, yikes } from '../../warn.svelte';
import { t } from '../../translations.svelte';
let { locations } = $props();
let { locations, selected = $bindable(null) } = $props();
async function toggleChildren(ev, location){
ev.preventDefault();
ev.stopPropagation();
selected = location;
if (location.locations) {
delete location.locations;
} else {
@@ -32,7 +33,7 @@
<li onclick={e => toggleChildren(e, location)} class={location.locations?'expanded':'collapsed'}>
{location.name}
{#if location.locations}
<svelte:self locations={location.locations} />
<svelte:self locations={location.locations} bind:selected />
{/if}
</li>
{/each}