mirror of
https://github.com/BookStackApp/BookStack.git
synced 2025-08-07 23:03:00 +03:00
Lexical: Added a media toolbar, improved toolbars and media selection
- Updated toolbars to auto-refresh ui if it attempts to update targeting a DOM element which no longer exists. - Removed MediaNode dom specific click handling which was causing selection issues, and did not seem to be needed now.
This commit is contained in:
@@ -238,15 +238,9 @@ export class MediaNode extends ElementNode {
|
||||
|
||||
createDOM(_config: EditorConfig, _editor: LexicalEditor) {
|
||||
const media = this.createInnerDOM();
|
||||
const wrap = el('span', {
|
||||
return el('span', {
|
||||
class: media.className + ' editor-media-wrap',
|
||||
}, [media]);
|
||||
|
||||
wrap.addEventListener('click', e => {
|
||||
_editor.update(() => $selectSingleNode(this));
|
||||
});
|
||||
|
||||
return wrap;
|
||||
}
|
||||
|
||||
updateDOM(prevNode: MediaNode, dom: HTMLElement): boolean {
|
||||
|
Reference in New Issue
Block a user