aboutsummaryrefslogtreecommitdiff
path: root/src/new_fields/Doc.ts
diff options
context:
space:
mode:
authorFawn <fangrui_tong@brown.edu>2019-06-21 17:41:20 -0400
committerFawn <fangrui_tong@brown.edu>2019-06-21 17:41:20 -0400
commit32ef8d83d5829e2faadbebaf6f9b694df5d7ea02 (patch)
tree43105f51af6e03af2ddfed7fe4f2983793829539 /src/new_fields/Doc.ts
parent7962aff8431b692af5229cd8e6c390bbe1110336 (diff)
link menu styling
Diffstat (limited to 'src/new_fields/Doc.ts')
-rw-r--r--src/new_fields/Doc.ts17
1 files changed, 6 insertions, 11 deletions
diff --git a/src/new_fields/Doc.ts b/src/new_fields/Doc.ts
index 5ce47fc2f..fda788f2d 100644
--- a/src/new_fields/Doc.ts
+++ b/src/new_fields/Doc.ts
@@ -234,32 +234,27 @@ export namespace Doc {
export function MakeCopy(doc: Doc, copyProto: boolean = false): Doc {
const copy = new Doc;
Object.keys(doc).forEach(key => {
+ console.log(key);
const field = doc[key];
if (key === "proto" && copyProto) {
+ console.log(1);
if (field instanceof Doc) {
+ console.log(2);
copy[key] = Doc.MakeCopy(field);
}
} else {
if (field instanceof RefField) {
+ console.log(3);
copy[key] = field;
} else if (field instanceof ObjectField) {
+ console.log(4);
copy[key] = ObjectField.MakeCopy(field);
} else {
+ console.log(5);
copy[key] = field;
}
}
});
- console.log("COPY", StrCast(doc.title));
- let links = LinkManager.Instance.findAllRelatedLinks(doc);
- links.forEach(linkDoc => {
- let opp = LinkManager.Instance.findOppositeAnchor(linkDoc, doc);
- console.log("OPP", StrCast(opp.title));
- DocUtils.MakeLink(opp, copy);
- });
-
- LinkManager.Instance.allLinks.forEach(l => {
- console.log("LINK", StrCast(Cast(l.anchor1, Doc, new Doc).title), StrCast(Cast(l.anchor2, Doc, new Doc).title));
- });
return copy;
}