mirror of
https://github.com/hcengineering/platform.git
synced 2025-01-03 00:43:59 +03:00
fix: save documents maxWidth to local storage (#7184)
Signed-off-by: Alexander Onnikov <Alexander.Onnikov@xored.com>
This commit is contained in:
parent
dd8ba84a9b
commit
017353ece3
@ -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'}
|
||||
|
Loading…
Reference in New Issue
Block a user