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.ts9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/client/util/DragManager.ts b/src/client/util/DragManager.ts
index 82d30e0e6..4787ac40f 100644
--- a/src/client/util/DragManager.ts
+++ b/src/client/util/DragManager.ts
@@ -45,6 +45,9 @@ export function SetupDrag(_reference: React.RefObject<HTMLElement>, docFunc: ()
export async function DragLinkAsDocument(dragEle: HTMLElement, x: number, y: number, linkDoc: Doc, sourceDoc: Doc) {
let draggeddoc = LinkManager.Instance.findOppositeAnchor(linkDoc, sourceDoc);
+
+ // TODO: if not in same context then don't drag
+
let moddrag = await Cast(draggeddoc.annotationOn, Doc);
let dragData = new DragManager.DocumentDragData(moddrag ? [moddrag] : [draggeddoc]);
DragManager.StartDocumentDrag([dragEle], dragData, x, y, {
@@ -58,6 +61,9 @@ export async function DragLinkAsDocument(dragEle: HTMLElement, x: number, y: num
export async function DragLinksAsDocuments(dragEle: HTMLElement, x: number, y: number, sourceDoc: Doc) {
let srcTarg = sourceDoc.proto;
let draggedDocs: Doc[] = [];
+
+ // TODO: if not in same context then don't drag
+
if (srcTarg) {
let linkDocs = LinkManager.Instance.findAllRelatedLinks(srcTarg);
if (linkDocs) {
@@ -74,6 +80,9 @@ export async function DragLinksAsDocuments(dragEle: HTMLElement, x: number, y: n
if (doc) moddrag.push(doc);
}
let dragData = new DragManager.DocumentDragData(moddrag.length ? moddrag : draggedDocs);
+ // dragData.moveDocument = (document, targetCollection, addDocument) => {
+ // return false;
+ // };
DragManager.StartDocumentDrag([dragEle], dragData, x, y, {
handlers: {
dragComplete: action(emptyFunction),