diff --git a/src/lib/components/common/Folder.svelte b/src/lib/components/common/Folder.svelte index 70d646136..a394127e1 100644 --- a/src/lib/components/common/Folder.svelte +++ b/src/lib/components/common/Folder.svelte @@ -15,7 +15,11 @@ export let id = ''; export let name = ''; export let collapsible = true; - export let onCreateFolder: null | Function = null; + + export let onAddLabel: string = ''; + export let onAdd: null | Function = null; + + export let dragAndDrop = true; export let className = ''; @@ -87,12 +91,18 @@ }; onMount(() => { + if (!dragAndDrop) { + return; + } folderElement.addEventListener('dragover', onDragOver); folderElement.addEventListener('drop', onDrop); folderElement.addEventListener('dragleave', onDragLeave); }); onDestroy(() => { + if (!dragAndDrop) { + return; + } folderElement.addEventListener('dragover', onDragOver); folderElement.removeEventListener('drop', onDrop); folderElement.removeEventListener('dragleave', onDragLeave); @@ -133,15 +143,15 @@ - {#if onCreateFolder} + {#if onAdd}