diff options
-rw-r--r-- | src/client/documents/DocUtils.ts | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/client/documents/DocUtils.ts b/src/client/documents/DocUtils.ts index 7b36c3a66..db0770b12 100644 --- a/src/client/documents/DocUtils.ts +++ b/src/client/documents/DocUtils.ts @@ -308,6 +308,13 @@ export namespace DocUtils { */ export async function DocumentFromType(type: string, path: string, options: DocumentOptions, overwriteDoc?: Doc): Promise<Opt<Doc>> { let ctor: ((path: string, options: DocumentOptions, overwriteDoc?: Doc) => Doc | Promise<Doc | undefined>) | undefined; + + if (type.indexOf('scrapbook') !== -1) { + ctor = Docs.Create.ScrapbookDocument; + if (!options._width) options._width = 400; + if (!options._title) options._title = 'New Scrapbook'; + } + if (type.indexOf('image') !== -1) { ctor = Docs.Create.ImageDocument; if (!options._width) options._width = 300; |