mirror of
https://0xacab.org/sutty/sutty
synced 2024-11-15 08:11:41 +00:00
Merge branch 'rails' of 0xacab.org:sutty/sutty into rails
This commit is contained in:
commit
fce3e7c8b3
1 changed files with 9 additions and 2 deletions
|
@ -61,8 +61,13 @@ function select (editor: Editor, el: HTMLElement): void {
|
|||
|
||||
const innerEl = el.querySelector<HTMLElement>('[data-multimedia-inner]')
|
||||
if (!innerEl) throw new Error('No hay multimedia válida')
|
||||
if (innerEl.tagName !== 'P')
|
||||
editor.toolbar.auxiliary.multimedia.altEl.value = getAlt(innerEl) || ''
|
||||
if (innerEl.tagName === "P") {
|
||||
editor.toolbar.auxiliary.multimedia.altEl.value = "";
|
||||
editor.toolbar.auxiliary.multimedia.altEl.disabled = true;
|
||||
} else {
|
||||
editor.toolbar.auxiliary.multimedia.altEl.value = getAlt(innerEl) || "";
|
||||
editor.toolbar.auxiliary.multimedia.altEl.disabled = false;
|
||||
}
|
||||
|
||||
setAuxiliaryToolbar(editor, editor.toolbar.auxiliary.multimedia.parentEl)
|
||||
}
|
||||
|
@ -146,6 +151,8 @@ export function setupAuxiliaryToolbar (editor: Editor): void {
|
|||
setAlt(el, editor.toolbar.auxiliary.multimedia.altEl.value)
|
||||
selectedEl.replaceChild(el, innerEl)
|
||||
|
||||
select(editor, selectedEl)
|
||||
|
||||
delete selectedEl.dataset.editorError
|
||||
})
|
||||
.catch(err => {
|
||||
|
|
Loading…
Reference in a new issue