improving drag'n'drop of locations

Signed-off-by: Stephan Richter <s.richter@srsoftware.de>
This commit is contained in:
2025-10-25 23:26:40 +02:00
parent 3caf51f52d
commit ea616ed2a1

View File

@@ -24,6 +24,11 @@
return false;
}
function start_drag(e,loc){
e.stopPropagation();
drag_start(loc)
}
function flat(x){
return JSON.parse(JSON.stringify(x));
}
@@ -98,12 +103,6 @@
}
</script>
<style>
.highlight > span{
background: lime;
}
</style>
<ul>
{#each locations as location}
<li onclick={e => toggleChildren(e, location)}
@@ -112,7 +111,7 @@
ondragover={e => drag_over(e,location)}
ondrop={e => onDrop(e,location)}
ondragleave={e => delete location.highlight}
ondragstart={e => drag_start(location)} >
ondragstart={e => start_drag(e,location)} >
<span class="name">{location.name}</span>
{#if location.locations}
<svelte:self locations={location.locations} {drag_start} {move_dragged_to} parent={{location:location.id}} bind:selected />