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
|
$: locked = doc?.lockedBy != null
|
||||||
$: readonly = $restrictionStore.readonly || locked
|
$: readonly = $restrictionStore.readonly || locked
|
||||||
|
|
||||||
|
let useMaxWidth = getUseMaxWidth()
|
||||||
|
$: saveUseMaxWidth(useMaxWidth)
|
||||||
|
|
||||||
export function canClose (): boolean {
|
export function canClose (): boolean {
|
||||||
return false
|
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(() => {
|
onMount(() => {
|
||||||
dispatch('open', { ignoreKeys: ['comments', 'name'] })
|
dispatch('open', { ignoreKeys: ['comments', 'name'] })
|
||||||
})
|
})
|
||||||
@ -245,7 +257,7 @@
|
|||||||
isHeader={false}
|
isHeader={false}
|
||||||
isCustomAttr={false}
|
isCustomAttr={false}
|
||||||
isSub={false}
|
isSub={false}
|
||||||
useMaxWidth={false}
|
bind:useMaxWidth
|
||||||
printHeader={false}
|
printHeader={false}
|
||||||
{embedded}
|
{embedded}
|
||||||
adaptive={'default'}
|
adaptive={'default'}
|
||||||
|
Loading…
Reference in New Issue
Block a user