uberf-7755: fix image toolbar visibility (#6208)

Signed-off-by: Alexey Zinoviev <alexey.zinoviev@xored.com>
This commit is contained in:
Alexey Zinoviev 2024-08-01 07:56:55 +04:00 committed by GitHub
parent 868556471d
commit 0bb4bb04ac
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 6 additions and 1 deletions

View File

@ -416,6 +416,7 @@
toolbar: {
element: imageToolbarElement,
boundary,
appendTo: () => boundary ?? element,
isHidden: () => !showToolbar
}
}

View File

@ -41,6 +41,7 @@ export interface EditorKitOptions extends DefaultKitOptions {
toolbar?: {
element: HTMLElement
boundary?: HTMLElement
appendTo?: HTMLElement | (() => HTMLElement)
isHidden?: () => boolean
}
})
@ -232,7 +233,10 @@ async function buildEditorKit (): Promise<Extension<EditorKitOptions, any>> {
if (this.options.image?.toolbar !== undefined) {
imageOptions.toolbar = {
...this.options.image?.toolbar,
tippyOptions: getTippyOptions(this.options.image?.toolbar?.boundary)
tippyOptions: getTippyOptions(
this.options.image?.toolbar?.boundary,
this.options.image?.toolbar?.appendTo
)
}
}