aboutsummaryrefslogtreecommitdiff
path: root/src/client/util/DragManager.ts
diff options
context:
space:
mode:
Diffstat (limited to 'src/client/util/DragManager.ts')
-rw-r--r--src/client/util/DragManager.ts4
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);