diff options
author | bobzel <zzzman@gmail.com> | 2023-04-17 15:19:13 -0400 |
---|---|---|
committer | bobzel <zzzman@gmail.com> | 2023-04-17 15:19:13 -0400 |
commit | 2c154f328d6556d99f21a778c8d78b41de77f5c9 (patch) | |
tree | 200607bf64a0be390e62121aa023e1f255e2ea12 /src/client/views/linking/LinkMenuItem.tsx | |
parent | 3c8cb517c811f94dce1e3d8430e07af316642365 (diff) | |
parent | 57983d95ceeb364e3e0a282daea13035114ddb3f (diff) |
Merge branch 'master' into advanced-trails
Diffstat (limited to 'src/client/views/linking/LinkMenuItem.tsx')
-rw-r--r-- | src/client/views/linking/LinkMenuItem.tsx | 21 |
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); } } |