aboutsummaryrefslogtreecommitdiff
path: root/src/fields/Doc.ts
diff options
context:
space:
mode:
authorbobzel <zzzman@gmail.com>2022-02-09 08:59:32 -0500
committerbobzel <zzzman@gmail.com>2022-02-09 08:59:32 -0500
commita6d904bcd18a2c9962abfd9b5b325340f6b18b0d (patch)
tree32ab8f94e8f742d9303ec06029247931f1ab3895 /src/fields/Doc.ts
parent66fb0e4bbf88a5e9bcb5869dd7c8b8a7714de024 (diff)
speeding up rendering using bitmaps for webpages and other heavyweight docs.
Diffstat (limited to 'src/fields/Doc.ts')
-rw-r--r--src/fields/Doc.ts5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/fields/Doc.ts b/src/fields/Doc.ts
index 8a5491b4b..0b9a8b3fe 100644
--- a/src/fields/Doc.ts
+++ b/src/fields/Doc.ts
@@ -520,7 +520,8 @@ export namespace Doc {
Doc.SetLayout(alias, Doc.MakeAlias(layout));
}
alias.aliasOf = doc;
- alias.title = ComputedField.MakeFunction(`renameAlias(this, ${Doc.GetProto(doc).aliasNumber = NumCast(Doc.GetProto(doc).aliasNumber) + 1})`);
+ alias.aliasNumber = Doc.GetProto(doc).aliasNumber = NumCast(Doc.GetProto(doc).aliasNumber) + 1;
+ alias.title = ComputedField.MakeFunction(`renameAlias(this)`);
alias.author = Doc.CurrentUserEmail;
Doc.AddDocToList(Doc.GetProto(doc)[DataSym], "aliases", alias);
@@ -1391,7 +1392,7 @@ export namespace Doc {
}
Scripting.addGlobal(function idToDoc(id: string): any { return DocServer.GetCachedRefField(id); });
-Scripting.addGlobal(function renameAlias(doc: any, n: any) { return StrCast(Doc.GetProto(doc).title).replace(/\([0-9]*\)/, "") + `(${n})`; });
+Scripting.addGlobal(function renameAlias(doc: any) { return StrCast(Doc.GetProto(doc).title).replace(/\([0-9]*\)/, "") + `(${doc.aliasNumber})`; });
Scripting.addGlobal(function getProto(doc: any) { return Doc.GetProto(doc); });
Scripting.addGlobal(function getDocTemplate(doc?: any) { return Doc.getDocTemplate(doc); });
Scripting.addGlobal(function getAlias(doc: any) { return Doc.MakeAlias(doc); });