preparing to make items/locations referencable

Signed-off-by: Stephan Richter <s.richter@srsoftware.de>
This commit is contained in:
2025-11-03 08:47:59 +01:00
parent 8e10909c81
commit 9a377a8871

View File

@@ -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);
</script>
<h2>{t('Stock')}</h2>
{#if location_id}
{location_id}
{/if}
<div class="grid3">
<div class="locations">
{#if top_level}