aboutsummaryrefslogtreecommitdiff
path: root/src/client/documents/Documents.ts
diff options
context:
space:
mode:
authorbobzel <zzzman@gmail.com>2024-03-23 14:55:20 -0400
committerbobzel <zzzman@gmail.com>2024-03-23 14:55:20 -0400
commit695ee551e3013be7b741d127a58a69ed797d2891 (patch)
treede4ddaa24d54c00155898aede329102b4e2a0aef /src/client/documents/Documents.ts
parent462580bf70ff563dbfe33a84b8cd015e637cdf7e (diff)
added empty image tool and fixed createCustomView api
Diffstat (limited to 'src/client/documents/Documents.ts')
-rw-r--r--src/client/documents/Documents.ts6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/client/documents/Documents.ts b/src/client/documents/Documents.ts
index 37db23bdc..d68021062 100644
--- a/src/client/documents/Documents.ts
+++ b/src/client/documents/Documents.ts
@@ -1780,10 +1780,7 @@ export namespace DocUtils {
} // applies a custom template to a document. the template is identified by it's short name (e.g, slideView not layout_slideView)
export function makeCustomViewClicked(doc: Doc, creator: Opt<(documents: Array<Doc>, options: DocumentOptions, id?: string) => Doc>, templateSignature: string = 'custom', docLayoutTemplate?: Doc) {
const batch = UndoManager.StartBatch('makeCustomViewClicked');
- runInAction(() => {
- doc.layout_fieldKey = 'layout_' + templateSignature;
- createCustomView(doc, creator, templateSignature, docLayoutTemplate);
- });
+ createCustomView(doc, creator, templateSignature, docLayoutTemplate);
batch.end();
return doc;
}
@@ -1807,6 +1804,7 @@ export namespace DocUtils {
}
export function createCustomView(doc: Doc, creator: Opt<(documents: Array<Doc>, options: DocumentOptions, id?: string) => Doc>, templateSignature: string = 'custom', docLayoutTemplate?: Doc) {
const templateName = templateSignature.replace(/\(.*\)/, '');
+ doc.layout_fieldKey = 'layout_' + (templateSignature || docLayoutTemplate?.title);
docLayoutTemplate = docLayoutTemplate || findTemplate(templateName, StrCast(doc.isGroup && doc.transcription ? 'transcription' : doc.type), templateSignature);
const customName = 'layout_' + templateSignature;