mirror of
https://github.com/hcengineering/platform.git
synced 2025-04-13 11:50:56 +00:00
EQMS-1326 Make drawing board readonly when editor is readonly (#7485)
Signed-off-by: Alexander Onnikov <Alexander.Onnikov@xored.com>
This commit is contained in:
parent
2158661df5
commit
4fa36837c1
@ -31,6 +31,8 @@
|
||||
const maxHeight = 1000
|
||||
const minHeight = 100
|
||||
|
||||
$: readonly = !editor.isEditable || !selected
|
||||
|
||||
let savedBoard: SavedBoard
|
||||
let resizer: HTMLElement
|
||||
let startY: number
|
||||
@ -137,7 +139,7 @@
|
||||
savedCmds={savedBoard.commands}
|
||||
savedProps={savedBoard.props}
|
||||
resizeable={true}
|
||||
readonly={!selected}
|
||||
{readonly}
|
||||
{loading}
|
||||
{selected}
|
||||
height={resizedHeight ?? node.attrs.height ?? defaultHeight}
|
||||
@ -153,7 +155,7 @@
|
||||
}}
|
||||
/>
|
||||
</div>
|
||||
{#if selected}
|
||||
{#if selected && !readonly}
|
||||
<div
|
||||
class="handle resizer"
|
||||
bind:this={resizer}
|
||||
|
@ -22,6 +22,7 @@
|
||||
|
||||
export let savedCmds: YArray<DrawingCmd>
|
||||
export let savedProps: YMap<any>
|
||||
export let readonly = false
|
||||
|
||||
const dispatch = createEventDispatcher()
|
||||
|
||||
@ -41,6 +42,6 @@
|
||||
dispatch('close')
|
||||
}}
|
||||
>
|
||||
<DrawingBoardEditor {savedCmds} {savedProps} grabFocus />
|
||||
<DrawingBoardEditor {savedCmds} {savedProps} {readonly} grabFocus />
|
||||
</Dialog>
|
||||
{/if}
|
||||
|
@ -38,7 +38,8 @@ export function showBoardPopup (board: SavedBoard, editor: Editor): void {
|
||||
DrawingBoardPopup,
|
||||
{
|
||||
savedCmds: board.commands,
|
||||
savedProps: board.props
|
||||
savedProps: board.props,
|
||||
readonly: !editor.isEditable
|
||||
},
|
||||
'centered',
|
||||
() => {
|
||||
|
Loading…
Reference in New Issue
Block a user