preparing to make items/locations referencable
Signed-off-by: Stephan Richter <s.richter@srsoftware.de>
This commit is contained in:
@@ -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}
|
||||
|
||||
Reference in New Issue
Block a user