From 9a377a887197e75357c57b945ccb9e9480ab91f4 Mon Sep 17 00:00:00 2001 From: Stephan Richter Date: Mon, 3 Nov 2025 08:47:59 +0100 Subject: [PATCH] preparing to make items/locations referencable Signed-off-by: Stephan Richter --- frontend/src/routes/stock/Index.svelte | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/frontend/src/routes/stock/Index.svelte b/frontend/src/routes/stock/Index.svelte index fcc9fb9..4da8d36 100644 --- a/frontend/src/routes/stock/Index.svelte +++ b/frontend/src/routes/stock/Index.svelte @@ -17,6 +17,7 @@ let location = $state(null); let draggedItem = $state(null) let draggedLocation = $state(null) + let { location_id } = $props(); $effect(() => { // This effect runs whenever `location` changes @@ -122,6 +123,7 @@ function load(){ loadUserLocations(); + unfoldPath(); loadProperties(); } @@ -167,18 +169,25 @@ window.history.replaceState(window.history.state, '', url); } + // tries to unfold the path to a certain location, if a locationId is supplied via URL + function unfoldPath(){ + if (!locationId) return; + // TODO + } + function unlistLocation(loc){ for (var owner of top_level){ if (owner.locations && dropNestedLocation(owner.locations,loc)) break; } } - - onMount(load);

{t('Stock')}

+{#if location_id} +{location_id} +{/if}
{#if top_level}