aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/nodes/DocumentView.tsx
diff options
context:
space:
mode:
authorTyler Schicke <tyler_schicke@brown.edu>2019-07-14 22:20:43 -0400
committerTyler Schicke <tyler_schicke@brown.edu>2019-07-14 22:20:43 -0400
commit99344418b2141721c0c4e15fd871ff3586d420fb (patch)
tree1d9b29246e2d9fb49186dd0c76c201a6e29b51b3 /src/client/views/nodes/DocumentView.tsx
parent8c80710f241376043e8700ec79277fc039f3a00b (diff)
parent9fbe9e9b452a332ecc6f79f09a24d597304246c2 (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.tsx12
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;