aboutsummaryrefslogtreecommitdiff
path: root/src/fields/Doc.ts
diff options
context:
space:
mode:
authorbobzel <zzzman@gmail.com>2020-09-13 04:29:37 -0400
committerbobzel <zzzman@gmail.com>2020-09-13 04:29:37 -0400
commitbf8a62fbb1b70bc013ec2f342930f35d6108065b (patch)
tree162ef710b7156070301a2f78cbf2698e78ea2544 /src/fields/Doc.ts
parente99637ef4c03a438db7d0372aaf650ac9920641a (diff)
fixed making delegates of custom headerViews. fixed non-responsive carriage returns in textBoxes occasionally at the end of the text stream. fixed upating titles on templated text boxes. fixed setting layoutfield values in DashFieldViews to update the template and layout doc.
Diffstat (limited to 'src/fields/Doc.ts')
-rw-r--r--src/fields/Doc.ts10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/fields/Doc.ts b/src/fields/Doc.ts
index be62249c6..9553c4c7b 100644
--- a/src/fields/Doc.ts
+++ b/src/fields/Doc.ts
@@ -782,6 +782,7 @@ export namespace Doc {
if (doc) {
const delegate = new Doc(id, true);
delegate.proto = doc;
+ delegate.isPrototype = true;
delegate.author = Doc.CurrentUserEmail;
title && (delegate.title = title);
return delegate;
@@ -1134,6 +1135,14 @@ export namespace Doc {
}
return ndoc;
}
+ export function delegateDragFactory(dragFactory: Doc) {
+ const ndoc = Doc.MakeDelegate(dragFactory);
+ if (ndoc && dragFactory["dragFactory-count"] !== undefined) {
+ dragFactory["dragFactory-count"] = NumCast(dragFactory["dragFactory-count"]) + 1;
+ Doc.GetProto(ndoc).title = ndoc.title + " " + NumCast(dragFactory["dragFactory-count"]).toString();
+ }
+ return ndoc;
+ }
export namespace Get {
@@ -1284,6 +1293,7 @@ Scripting.addGlobal(function getDocTemplate(doc?: any) { return Doc.getDocTempla
Scripting.addGlobal(function getAlias(doc: any) { return Doc.MakeAlias(doc); });
Scripting.addGlobal(function getCopy(doc: any, copyProto: any) { return doc.isTemplateDoc ? Doc.ApplyTemplate(doc) : Doc.MakeCopy(doc, copyProto); });
Scripting.addGlobal(function copyDragFactory(dragFactory: Doc) { return Doc.copyDragFactory(dragFactory); });
+Scripting.addGlobal(function delegateDragFactory(dragFactory: Doc) { return Doc.delegateDragFactory(dragFactory); });
Scripting.addGlobal(function copyField(field: any) { return field instanceof ObjectField ? ObjectField.MakeCopy(field) : field; });
Scripting.addGlobal(function docList(field: any) { return DocListCast(field); });
Scripting.addGlobal(function setInPlace(doc: any, field: any, value: any) { return Doc.SetInPlace(doc, field, value, false); });