diff options
author | Tyler Schicke <tyler_schicke@brown.edu> | 2019-07-14 22:20:43 -0400 |
---|---|---|
committer | Tyler Schicke <tyler_schicke@brown.edu> | 2019-07-14 22:20:43 -0400 |
commit | 99344418b2141721c0c4e15fd871ff3586d420fb (patch) | |
tree | 1d9b29246e2d9fb49186dd0c76c201a6e29b51b3 /src/client/views/nodes/DocumentView.tsx | |
parent | 8c80710f241376043e8700ec79277fc039f3a00b (diff) | |
parent | 9fbe9e9b452a332ecc6f79f09a24d597304246c2 (diff) |
Merge branch 'master' of github-tsch-brown:browngraphicslab/Dash-Web into search_virt
Diffstat (limited to 'src/client/views/nodes/DocumentView.tsx')
-rw-r--r-- | src/client/views/nodes/DocumentView.tsx | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/client/views/nodes/DocumentView.tsx b/src/client/views/nodes/DocumentView.tsx index fcb38487d..2c1813482 100644 --- a/src/client/views/nodes/DocumentView.tsx +++ b/src/client/views/nodes/DocumentView.tsx @@ -421,6 +421,18 @@ export class DocumentView extends DocComponent<DocumentViewProps, Document>(Docu @undoBatch @action drop = async (e: Event, de: DragManager.DropEvent) => { + if (de.data instanceof DragManager.AnnotationDragData) { + e.stopPropagation(); + let annotationDoc = de.data.annotationDocument; + annotationDoc.linkedToDoc = true; + let targetDoc = this.props.Document; + let annotations = await DocListCastAsync(annotationDoc.annotations); + if (annotations) { + annotations.forEach(anno => { + anno.target = targetDoc; + }); + } + } if (de.data instanceof DragManager.LinkDragData) { let sourceDoc = de.data.linkSourceDocument; let destDoc = this.props.Document; |