aboutsummaryrefslogtreecommitdiff
path: root/src/client/util
diff options
context:
space:
mode:
authorSam Wilkins <samwilkins333@gmail.com>2020-05-03 15:05:07 -0700
committerSam Wilkins <samwilkins333@gmail.com>2020-05-03 15:05:07 -0700
commitdd5641a55cbfe4f3acc5ae652948be28a08469d7 (patch)
tree06b4f45115b87e2c8eb4900b816c9197494b58d0 /src/client/util
parentb8a62e6404a695e57ab1305fd13be23e8d935360 (diff)
parenta087ea8dc3de156e23cb99f91bc1ea79365c7001 (diff)
Merge branch 'master' of https://github.com/browngraphicslab/Dash-Web
Diffstat (limited to 'src/client/util')
-rw-r--r--src/client/util/DragManager.ts4
-rw-r--r--src/client/util/DropConverter.ts2
2 files changed, 4 insertions, 2 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);
diff --git a/src/client/util/DropConverter.ts b/src/client/util/DropConverter.ts
index 60a6bbb3c..b1993d401 100644
--- a/src/client/util/DropConverter.ts
+++ b/src/client/util/DropConverter.ts
@@ -68,7 +68,7 @@ export function convertDropDataToButtons(data: DragManager.DocumentDragData) {
});
dbox.dragFactory = layoutDoc;
dbox.removeDropProperties = doc.removeDropProperties instanceof ObjectField ? ObjectField.MakeCopy(doc.removeDropProperties) : undefined;
- dbox.onDragStart = ScriptField.MakeFunction('getCopy(this.dragFactory, true)');
+ dbox.onDragStart = ScriptField.MakeFunction('makeDelegate(this.dragFactory)');
} else if (doc.isButtonBar) {
dbox.ignoreClick = true;
}