Skip to content

Commit

Permalink
EQMS-1326 Make drawing board readonly when editor is readonly (#7485)
Browse files Browse the repository at this point in the history
Signed-off-by: Alexander Onnikov <[email protected]>
  • Loading branch information
aonnikov authored Dec 17, 2024
1 parent 2158661 commit 4fa3683
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@
const maxHeight = 1000
const minHeight = 100
$: readonly = !editor.isEditable || !selected
let savedBoard: SavedBoard
let resizer: HTMLElement
let startY: number
Expand Down Expand Up @@ -137,7 +139,7 @@
savedCmds={savedBoard.commands}
savedProps={savedBoard.props}
resizeable={true}
readonly={!selected}
{readonly}
{loading}
{selected}
height={resizedHeight ?? node.attrs.height ?? defaultHeight}
Expand All @@ -153,7 +155,7 @@
}}
/>
</div>
{#if selected}
{#if selected && !readonly}
<div
class="handle resizer"
bind:this={resizer}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
export let savedCmds: YArray<DrawingCmd>
export let savedProps: YMap<any>
export let readonly = false
const dispatch = createEventDispatcher()
Expand All @@ -41,6 +42,6 @@
dispatch('close')
}}
>
<DrawingBoardEditor {savedCmds} {savedProps} grabFocus />
<DrawingBoardEditor {savedCmds} {savedProps} {readonly} grabFocus />
</Dialog>
{/if}
Original file line number Diff line number Diff line change
Expand Up @@ -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',
() => {
Expand Down

0 comments on commit 4fa3683

Please sign in to comment.