aboutsummaryrefslogtreecommitdiff
path: root/src/client/documents/Documents.ts
diff options
context:
space:
mode:
authorFawn <fangrui_tong@brown.edu>2019-06-15 17:17:45 -0400
committerFawn <fangrui_tong@brown.edu>2019-06-15 17:17:45 -0400
commitb4bd43f6e79c9dec30842262f270ca6122f1184a (patch)
tree55d2299973e4c479f7f70ca79dfcb1eb872dae82 /src/client/documents/Documents.ts
parentd3e734140c52e69f3d07f1ebe145e554a062addb (diff)
cleaned up some leftover linkedfromdocs/linkedtodocs
Diffstat (limited to 'src/client/documents/Documents.ts')
-rw-r--r--src/client/documents/Documents.ts31
1 files changed, 2 insertions, 29 deletions
diff --git a/src/client/documents/Documents.ts b/src/client/documents/Documents.ts
index 9cb41aecc..268dbc927 100644
--- a/src/client/documents/Documents.ts
+++ b/src/client/documents/Documents.ts
@@ -87,21 +87,11 @@ const delegateKeys = ["x", "y", "width", "height", "panX", "panY"];
export namespace DocUtils {
export function MakeLink(source: Doc, target: Doc) {
if (LinkManager.Instance.doesLinkExist(source, target)) return;
- // let protoSrc = source.proto ? source.proto : source;
- // let protoTarg = target.proto ? target.proto : target;
- UndoManager.RunInBatch(() => {
- // let groupDoc1 = Docs.TextDocument();
- // groupDoc1.proto!.type = "*";
- // groupDoc1.proto!.metadata = Docs.TextDocument();
- // let groupDoc2 = Docs.TextDocument();
- // groupDoc2.proto!.type = "*";
- // groupDoc2.proto!.metadata = Docs.TextDocument();
+ UndoManager.RunInBatch(() => {
let linkDoc = Docs.TextDocument({ width: 100, height: 30, borderRounding: -1 });
- //let linkDoc = new Doc;
- // linkDoc.proto!.title = source.proto!.title + " and " + target.proto!.title;
- // linkDoc.proto!.linkDescription = "";
+
linkDoc.proto!.anchor1 = source;
linkDoc.proto!.anchor1Page = source.curPage;
linkDoc.proto!.anchor1Groups = new List<Doc>([]);
@@ -110,23 +100,6 @@ export namespace DocUtils {
linkDoc.proto!.anchor2Page = target.curPage;
linkDoc.proto!.anchor2Groups = new List<Doc>([]);
- // linkDoc.proto!.linkedTo = target;
- // linkDoc.proto!.linkedToPage = target.curPage;
- // linkDoc.proto!.linkedFrom = source;
- // linkDoc.proto!.linkedFromPage = source.curPage;
-
- // let linkedFrom = Cast(protoTarg.linkedFromDocs, listSpec(Doc));
- // if (!linkedFrom) {
- // protoTarg.linkedFromDocs = linkedFrom = new List<Doc>();
- // }
- // linkedFrom.push(linkDoc);
-
- // let linkedTo = Cast(protoSrc.linkedToDocs, listSpec(Doc));
- // if (!linkedTo) {
- // protoSrc.linkedToDocs = linkedTo = new List<Doc>();
- // }
- // linkedTo.push(linkDoc);
-
LinkManager.Instance.allLinks.push(linkDoc);
return linkDoc;