From 8f223aa27272a84cd8d931e177c223413fad0c04 Mon Sep 17 00:00:00 2001 From: Anton Brechka Date: Mon, 10 Apr 2023 15:24:21 +0700 Subject: [PATCH] TSK-1040: Support editable for DraggableList Signed-off-by: Anton Brechka --- packages/presentation/src/components/DraggableList.svelte | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/presentation/src/components/DraggableList.svelte b/packages/presentation/src/components/DraggableList.svelte index b1ac64f549..3eb2ae5ef2 100644 --- a/packages/presentation/src/components/DraggableList.svelte +++ b/packages/presentation/src/components/DraggableList.svelte @@ -30,6 +30,7 @@ export let calcRank: (doc: DocWithRank, next: DocWithRank) => string export let showContextMenu: ((evt: MouseEvent, doc: Doc) => void) | undefined = undefined export let isDraft = false + export let editable = true const client = getClient() @@ -95,7 +96,7 @@ class:is-dragged-over-up={draggingIndex !== null && index < draggingIndex && index === hoveringIndex} class:is-dragged-over-down={draggingIndex !== null && index > draggingIndex && index === hoveringIndex} class:drag-over-highlight={index === dragOverIndex} - draggable={true} + draggable={editable} on:contextmenu|preventDefault={(ev) => checkIsNotDraft(object) && showContextMenu?.(ev, object)} on:dragstart={(ev) => handleDragStart(ev, index)} on:dragover|preventDefault={() => {