aboutsummaryrefslogtreecommitdiff
path: root/src/new_fields/Doc.ts
diff options
context:
space:
mode:
authorbob <bcz@cs.brown.edu>2019-11-13 11:44:52 -0500
committerbob <bcz@cs.brown.edu>2019-11-13 11:44:52 -0500
commite1930a62304db60d9eca542148995c5d03b79aea (patch)
tree0efd8b0083cd80e3f9f265fb39a3283807183367 /src/new_fields/Doc.ts
parent76411ba009c4265751431d255ab3cc9a3cfab69f (diff)
fixed search on client/server to work with richTextFields. got rid of 'text' field on richtextfield extensions.
Diffstat (limited to 'src/new_fields/Doc.ts')
-rw-r--r--src/new_fields/Doc.ts5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/new_fields/Doc.ts b/src/new_fields/Doc.ts
index 3bf1129b5..4531fd5e0 100644
--- a/src/new_fields/Doc.ts
+++ b/src/new_fields/Doc.ts
@@ -473,8 +473,9 @@ export namespace Doc {
export function CreateDocumentExtensionForField(doc: Doc, fieldKey: string) {
let docExtensionForField = new Doc(doc[Id] + fieldKey, true);
- docExtensionForField.title = fieldKey + ".ext";
+ docExtensionForField.title = fieldKey + ".ext"; // courtesy field--- shouldn't be needed except maybe for debugging
docExtensionForField.extendsDoc = doc; // this is used by search to map field matches on the extension doc back to the document it extends.
+ docExtensionForField.extendsField = fieldKey; // this can be used by search to map matches on the extension doc back to the field that was extended.
docExtensionForField.type = DocumentType.EXTENSION;
let proto: Doc | undefined = doc;
while (proto && !Doc.IsPrototype(proto) && proto.proto) {
@@ -568,7 +569,7 @@ export namespace Doc {
let layoutCustomLayout = Doc.MakeDelegate(templateDoc);
titleTarget && (Doc.GetProto(target).title = titleTarget);
- target.type = DocumentType.TEMPLATE;
+ Doc.GetProto(target).type = DocumentType.TEMPLATE;
target.onClick = templateDoc.onClick instanceof ObjectField && templateDoc.onClick[Copy]();
Doc.GetProto(target)[targetKey] = layoutCustomLayout;