From bf8a62fbb1b70bc013ec2f342930f35d6108065b Mon Sep 17 00:00:00 2001 From: bobzel Date: Sun, 13 Sep 2020 04:29:37 -0400 Subject: 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. --- src/fields/Doc.ts | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'src/fields/Doc.ts') 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); }); -- cgit v1.2.3-70-g09d2