aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/nodes/DocumentView.tsx
diff options
context:
space:
mode:
Diffstat (limited to 'src/client/views/nodes/DocumentView.tsx')
-rw-r--r--src/client/views/nodes/DocumentView.tsx6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/client/views/nodes/DocumentView.tsx b/src/client/views/nodes/DocumentView.tsx
index c31e8b8c4..108bd8e53 100644
--- a/src/client/views/nodes/DocumentView.tsx
+++ b/src/client/views/nodes/DocumentView.tsx
@@ -245,16 +245,18 @@ export class DocumentView extends React.Component<DocumentViewProps> {
destDoc.GetTAsync(KeyStore.Prototype, Document).then((protoDest) =>
sourceDoc.GetTAsync(KeyStore.Prototype, Document).then((protoSrc) => runInAction(() => {
- let dstTarg = (protoDest ? protoDest : destDoc);
- let srcTarg = (protoSrc ? protoSrc : sourceDoc);
linkDoc.Set(KeyStore.Title, new TextField("New Link"));
linkDoc.Set(KeyStore.LinkDescription, new TextField(""));
linkDoc.Set(KeyStore.LinkTags, new TextField("Default"));
+ let dstTarg = (protoDest ? protoDest : destDoc);
+ let srcTarg = (protoSrc ? protoSrc : sourceDoc);
linkDoc.Set(KeyStore.LinkedToDocs, dstTarg);
linkDoc.Set(KeyStore.LinkedFromDocs, srcTarg);
dstTarg.GetOrCreateAsync(KeyStore.LinkedFromDocs, ListField, field => { (field as ListField<Document>).Data.push(linkDoc) })
srcTarg.GetOrCreateAsync(KeyStore.LinkedToDocs, ListField, field => { (field as ListField<Document>).Data.push(linkDoc) })
+ if (this.props.AddDocument)
+ this.props.AddDocument(linkDoc, false);
}))
)
e.stopPropagation();