diff options
Diffstat (limited to 'src/client/documents')
| -rw-r--r-- | src/client/documents/Documents.ts | 6 | 
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; | 
