Browse Source

preparing to make items/locations referencable

Signed-off-by: Stephan Richter <s.richter@srsoftware.de>
module/stock
Stephan Richter 2 days ago
parent
commit
9a377a8871
  1. 13
      frontend/src/routes/stock/Index.svelte

13
frontend/src/routes/stock/Index.svelte

@ -17,6 +17,7 @@ @@ -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 @@ @@ -122,6 +123,7 @@
function load(){
loadUserLocations();
unfoldPath();
loadProperties();
}
@ -167,18 +169,25 @@ @@ -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);
</script>
<h2>{t('Stock')}</h2>
{#if location_id}
{location_id}
{/if}
<div class="grid3">
<div class="locations">
{#if top_level}

Loading…
Cancel
Save