aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/linking/LinkMenuItem.tsx
diff options
context:
space:
mode:
authorgeireann <geireann.lindfield@gmail.com>2023-04-20 11:26:50 -0400
committergeireann <geireann.lindfield@gmail.com>2023-04-20 11:26:50 -0400
commitb3c14800dc8d33e2dc99da8c9ed4ce0466fa468c (patch)
tree2980e2d6663add0a729eb02c23e16df8f2014fdc /src/client/views/linking/LinkMenuItem.tsx
parent6c3482a17839928818abaf82bc5be3c794174f4d (diff)
parent0a66b0f369a13d5f399bf125727aff73cd6fd1b4 (diff)
Merge branch 'master' of https://github.com/brown-dash/Dash-Web
Diffstat (limited to 'src/client/views/linking/LinkMenuItem.tsx')
-rw-r--r--src/client/views/linking/LinkMenuItem.tsx21
1 files changed, 3 insertions, 18 deletions
diff --git a/src/client/views/linking/LinkMenuItem.tsx b/src/client/views/linking/LinkMenuItem.tsx
index 29e7cd3ad..19d6c2ae2 100644
--- a/src/client/views/linking/LinkMenuItem.tsx
+++ b/src/client/views/linking/LinkMenuItem.tsx
@@ -44,25 +44,10 @@ export async function StartLinkTargetsDrag(dragEle: HTMLElement, docView: Docume
}
const dragData = new DragManager.DocumentDragData(moddrag.length ? moddrag : draggedDocs);
- dragData.moveDocument = (doc: Doc | Doc[], targetCollection: Doc | undefined, addDocument: (doc: Doc | Doc[]) => boolean): boolean => {
- docView.props.removeDocument?.(doc);
- addDocument(doc);
- return true;
- };
- const containingView = docView.props.ContainingCollectionView;
- const finishDrag = (e: DragManager.DragCompleteEvent) =>
- e.docDragData &&
- (e.docDragData.droppedDocuments = dragData.draggedDocuments.reduce((droppedDocs, d) => {
- const dvs = DocumentManager.Instance.getDocumentViews(d).filter(dv => dv.props.ContainingCollectionView === containingView);
- if (dvs.length) {
- dvs.forEach(dv => droppedDocs.push(dv.props.Document));
- } else {
- droppedDocs.push(Doc.MakeAlias(d));
- }
- return droppedDocs;
- }, [] as Doc[]));
+ dragData.canEmbed = true;
+ dragData.dropAction = 'alias';
- DragManager.StartDrag([dragEle], dragData, downX, downY, undefined, finishDrag);
+ DragManager.StartDocumentDrag([dragEle], dragData, downX, downY, undefined);
}
}