aboutsummaryrefslogtreecommitdiff
path: root/src/client/util/DragManager.ts
diff options
context:
space:
mode:
authorBob Zeleznik <zzzman@gmail.com>2020-05-09 15:56:11 -0400
committerBob Zeleznik <zzzman@gmail.com>2020-05-09 15:56:11 -0400
commit4914965affb984e04e847460ce1b5750807b316f (patch)
treee0f6805e097fc822e657e987bd75b18fbabf7e88 /src/client/util/DragManager.ts
parentf5c936b8f31c39513ef925f6f62a4ed3a66a4e86 (diff)
fixed missing gear in golden layout. fixed double dragging events. changed dragging to give prefernce to modifier keys over dropactions. changed names of Documents to Catalog. added document copy past with ctrl c/ctrl v
Diffstat (limited to 'src/client/util/DragManager.ts')
-rw-r--r--src/client/util/DragManager.ts7
1 files changed, 2 insertions, 5 deletions
diff --git a/src/client/util/DragManager.ts b/src/client/util/DragManager.ts
index cc8cc38dd..4f547e2f7 100644
--- a/src/client/util/DragManager.ts
+++ b/src/client/util/DragManager.ts
@@ -176,7 +176,7 @@ export namespace DragManager {
element: HTMLElement,
dropFunc: (e: Event, de: DropEvent) => void,
doc?: Doc,
- preDropFunc?: (e: Event, de: DropEvent) => void,
+ preDropFunc?: (e: Event, de: DropEvent, targetAction: dropActionType) => void,
): DragDropDisposer {
if ("canDrop" in element.dataset) {
throw new Error(
@@ -187,10 +187,7 @@ export namespace DragManager {
const handler = (e: Event) => dropFunc(e, (e as CustomEvent<DropEvent>).detail);
const preDropHandler = (e: Event) => {
const de = (e as CustomEvent<DropEvent>).detail;
- if (de.complete.docDragData && doc?.targetDropAction) {
- de.complete.docDragData.dropAction = StrCast(doc.targetDropAction) as dropActionType;
- }
- preDropFunc?.(e, de);
+ preDropFunc?.(e, de, StrCast(doc?.targetDropAction) as dropActionType);
};
element.addEventListener("dashOnDrop", handler);
doc && element.addEventListener("dashPreDrop", preDropHandler);