diff options
author | monikahedman <monika_hedman@brown.edu> | 2019-07-16 14:47:24 -0400 |
---|---|---|
committer | monikahedman <monika_hedman@brown.edu> | 2019-07-16 14:47:24 -0400 |
commit | b49f13d72033ab74bfecea00889fa81c85bfd533 (patch) | |
tree | 286cbfde9864c9a46f9501cd2975fb854a0d6f13 /src/new_fields/Doc.ts | |
parent | 189bb0ffd14fb0b8db0edbe813efe19f143a30fd (diff) | |
parent | 98c3a06256d2cbd720b2c193e5aa282c5dc25350 (diff) |
Merge branch 'search_virt' of https://github.com/browngraphicslab/Dash-Web into search_virt
Diffstat (limited to 'src/new_fields/Doc.ts')
-rw-r--r-- | src/new_fields/Doc.ts | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/new_fields/Doc.ts b/src/new_fields/Doc.ts index c5f9e7adf..0d9fa540f 100644 --- a/src/new_fields/Doc.ts +++ b/src/new_fields/Doc.ts @@ -312,16 +312,20 @@ export namespace Doc { } export function UpdateDocumentExtensionForField(doc: Doc, fieldKey: string) { - if (doc[fieldKey + "_ext"] === undefined) { + let extensionDoc = doc[fieldKey + "_ext"]; + if (extensionDoc === undefined) { setTimeout(() => { let docExtensionForField = new Doc(doc[Id] + fieldKey, true); docExtensionForField.title = "Extension of " + doc.title + "'s field:" + fieldKey; + docExtensionForField.extendsDoc = doc; let proto: Doc | undefined = doc; while (proto && !Doc.IsPrototype(proto)) { proto = proto.proto; } (proto ? proto : doc)[fieldKey + "_ext"] = docExtensionForField; }, 0); + } else if (extensionDoc instanceof Doc && extensionDoc.extendsDoc === undefined) { + setTimeout(() => (extensionDoc as Doc).extendsDoc = doc, 0); } } export function MakeAlias(doc: Doc) { |