Inherit 'full width' setting creating new child document

towards #5562
This commit is contained in:
Tom Moor
2023-07-15 23:21:59 -04:00
parent abb38ea447
commit 4b14fa5dd7
4 changed files with 16 additions and 3 deletions

View File

@@ -23,6 +23,10 @@ function DocumentNew() {
useEffect(() => {
async function createDocument() {
const params = queryString.parse(location.search);
const parentDocumentId = params.parentDocumentId?.toString();
const parentDocument = parentDocumentId
? documents.get(parentDocumentId)
: undefined;
let collection;
try {
@@ -31,7 +35,8 @@ function DocumentNew() {
}
const document = await documents.create({
collectionId: collection?.id,
parentDocumentId: params.parentDocumentId?.toString(),
parentDocumentId,
fullWidth: parentDocument?.fullWidth,
templateId: params.templateId?.toString(),
template: params.template === "true" ? true : false,
title: "",