diff --git a/plugins/document-resources/src/components/EditDoc.svelte b/plugins/document-resources/src/components/EditDoc.svelte index 62118056c3..b1814d3a60 100644 --- a/plugins/document-resources/src/components/EditDoc.svelte +++ b/plugins/document-resources/src/components/EditDoc.svelte @@ -70,6 +70,9 @@ $: locked = doc?.lockedBy != null $: readonly = $restrictionStore.readonly || locked + let useMaxWidth = getUseMaxWidth() + $: saveUseMaxWidth(useMaxWidth) + export function canClose (): boolean { return false } @@ -179,6 +182,15 @@ } } + function getUseMaxWidth (): boolean { + const useMaxWidth = localStorage.getItem('document.useMaxWidth') + return useMaxWidth === 'true' + } + + function saveUseMaxWidth (useMaxWidth: boolean): void { + localStorage.setItem('document.useMaxWidth', useMaxWidth.toString()) + } + onMount(() => { dispatch('open', { ignoreKeys: ['comments', 'name'] }) }) @@ -245,7 +257,7 @@ isHeader={false} isCustomAttr={false} isSub={false} - useMaxWidth={false} + bind:useMaxWidth printHeader={false} {embedded} adaptive={'default'}