diff options
author | Bob Zeleznik <zzzman@gmail.com> | 2019-03-28 00:27:36 -0400 |
---|---|---|
committer | Bob Zeleznik <zzzman@gmail.com> | 2019-03-28 00:27:36 -0400 |
commit | f6c6220d92b8556615f3c17463ca5b0c7452b439 (patch) | |
tree | bc4337392672e23d9b5be38bb966fe8e8c7a1435 /src/client/views/nodes/DocumentView.tsx | |
parent | 510c26bb46cb8b70cc3fad756396f39a8b7fd687 (diff) |
placeholder for drawing links.
Diffstat (limited to 'src/client/views/nodes/DocumentView.tsx')
-rw-r--r-- | src/client/views/nodes/DocumentView.tsx | 6 |
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(); |