working on loading items for location
This commit is contained in:
@@ -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}
|
||||
|
||||
Reference in New Issue
Block a user