diff options
author | Bob Zeleznik <zzzman@gmail.com> | 2020-05-02 14:31:16 -0400 |
---|---|---|
committer | Bob Zeleznik <zzzman@gmail.com> | 2020-05-02 14:31:16 -0400 |
commit | 100ad0da00f2a5cea13508abc0c3a8c644095d65 (patch) | |
tree | cd7a5e40e8d3b5f0ffb5b70fdef1be37ef975a0d /src/client/util/DragManager.ts | |
parent | 952bc0d744833ab79f69f2f13abde1e4cee68408 (diff) |
turn off targetDropAction when dropping in same colleciton. cleaned up PresBox stuff to use single template to render all contents (which are otherwise unmodified).
Diffstat (limited to 'src/client/util/DragManager.ts')
-rw-r--r-- | src/client/util/DragManager.ts | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/client/util/DragManager.ts b/src/client/util/DragManager.ts index c06ad3d60..041f2fc2c 100644 --- a/src/client/util/DragManager.ts +++ b/src/client/util/DragManager.ts @@ -185,7 +185,8 @@ export namespace DragManager { export function MakeDropTarget( element: HTMLElement, dropFunc: (e: Event, de: DropEvent) => void, - doc?: Doc + doc?: Doc, + preDropFunc?: (e: Event, de: DropEvent) => void, ): DragDropDisposer { if ("canDrop" in element.dataset) { throw new Error( @@ -199,6 +200,7 @@ export namespace DragManager { if (de.complete.docDragData && doc?.targetDropAction) { de.complete.docDragData.dropAction = StrCast(doc.targetDropAction) as dropActionType; } + preDropFunc?.(e, de); }; element.addEventListener("dashOnDrop", handler); doc && element.addEventListener("dashPreDrop", preDropHandler); |