allow drop on group #274

This commit is contained in:
Jan Prochazka 2022-11-10 09:45:41 +01:00
parent 909591404f
commit ebfa0a1939

View File

@ -35,19 +35,17 @@
return res; return res;
}); });
} }
</script>
<div function handleDrop(e) {
class="group"
on:click={() => (isExpanded = !isExpanded)}
on:drop={e => {
var data = e.dataTransfer.getData('app_object_drag_data'); var data = e.dataTransfer.getData('app_object_drag_data');
if (data && onDropOnGroup) { if (data && onDropOnGroup) {
e.stopPropagation(); e.stopPropagation();
onDropOnGroup(data, group); onDropOnGroup(data, group);
} }
}} }
> </script>
<div class="group" on:click={() => (isExpanded = !isExpanded)} on:drop={handleDrop}>
<span class="expand-icon"> <span class="expand-icon">
<FontIcon icon={groupIconFunc(isExpanded)} /> <FontIcon icon={groupIconFunc(isExpanded)} />
</span> </span>
@ -65,6 +63,7 @@
</div> </div>
{/if} {/if}
<div on:drop={handleDrop}>
{#each items as item} {#each items as item}
<AppObjectListItem <AppObjectListItem
isHidden={!item.isMatched} isHidden={!item.isMatched}
@ -77,6 +76,7 @@
{passProps} {passProps}
/> />
{/each} {/each}
</div>
{/if} {/if}
<style> <style>