aboutsummaryrefslogtreecommitdiff
path: root/src/client/documents/Documents.ts
diff options
context:
space:
mode:
authorTyler Schicke <tyler_schicke@brown.edu>2019-07-16 18:37:07 -0400
committerTyler Schicke <tyler_schicke@brown.edu>2019-07-16 18:37:07 -0400
commit430fd8c0a3dcaf92f599bf6c8b8032db8774bae7 (patch)
treea9820863fd4917f2046c116c0cbfd948ae6aa897 /src/client/documents/Documents.ts
parent31d2d8e058e0559707da352defd02585a3963353 (diff)
parent2e9adac91d724233787a7837e57955cc811a852a (diff)
Merge branch 'master' of github-tsch-brown:browngraphicslab/Dash-Web
Diffstat (limited to 'src/client/documents/Documents.ts')
-rw-r--r--src/client/documents/Documents.ts10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/client/documents/Documents.ts b/src/client/documents/Documents.ts
index 5bbfe1c49..af2b95659 100644
--- a/src/client/documents/Documents.ts
+++ b/src/client/documents/Documents.ts
@@ -483,18 +483,20 @@ export namespace Docs {
export namespace DocUtils {
- export function MakeLink(source: Doc, target: Doc, targetContext?: Doc, title: string = "", description: string = "", tags: string = "Default") {
+ export function MakeLink(source: Doc, target: Doc, targetContext?: Doc, title: string = "", description: string = "", tags: string = "Default", sourceContext?: Doc) {
if (LinkManager.Instance.doesLinkExist(source, target)) return;
let sv = DocumentManager.Instance.getDocumentView(source);
if (sv && sv.props.ContainingCollectionView && sv.props.ContainingCollectionView.props.Document === target) return;
if (target === CurrentUserUtils.UserDocument) return;
+ let linkDoc;
UndoManager.RunInBatch(() => {
- let linkDoc = Docs.Create.TextDocument({ width: 100, height: 30, borderRounding: "100%" });
+ linkDoc = Docs.Create.TextDocument({ width: 100, height: 30, borderRounding: "100%" });
linkDoc.type = DocumentType.LINK;
let linkDocProto = Doc.GetProto(linkDoc);
- linkDocProto.context = targetContext;
+ linkDocProto.targetContext = targetContext;
+ linkDocProto.sourceContext = sourceContext;
linkDocProto.title = title === "" ? source.title + " to " + target.title : title;
linkDocProto.linkDescription = description;
linkDocProto.linkTags = tags;
@@ -509,8 +511,8 @@ export namespace DocUtils {
LinkManager.Instance.addLink(linkDoc);
- return linkDoc;
}, "make link");
+ return linkDoc;
}
}