1
0
mirror of https://github.com/BookStackApp/BookStack.git synced 2025-08-07 23:03:00 +03:00

Lexical: Worked on toolbar styling, got format submenu working

This commit is contained in:
Dan Brown
2024-07-04 16:16:16 +01:00
parent 04c7e680fd
commit 2c96af9aea
6 changed files with 133 additions and 52 deletions

View File

@@ -7,10 +7,12 @@ export class EditorDropdownButton extends EditorContainerUiElement {
protected button: EditorButton;
protected childItems: EditorUiElement[];
protected open: boolean = false;
protected showOnHover: boolean = false;
constructor(button: EditorBasicButtonDefinition|EditorButton, children: EditorUiElement[]) {
constructor(button: EditorBasicButtonDefinition|EditorButton, showOnHover: boolean, children: EditorUiElement[]) {
super(children);
this.childItems = children
this.childItems = children;
this.showOnHover = showOnHover;
if (button instanceof EditorButton) {
this.button = button;
@@ -47,13 +49,15 @@ export class EditorDropdownButton extends EditorContainerUiElement {
class: 'editor-dropdown-menu-container',
}, [button, menu]);
handleDropdown(button, menu, () => {
handleDropdown({toggle : button, menu : menu,
showOnHover: this.showOnHover,
onOpen : () => {
this.open = true;
this.getContext().manager.triggerStateUpdateForElement(this.button);
}, () => {
}, onClose : () => {
this.open = false;
this.getContext().manager.triggerStateUpdateForElement(this.button);
});
}});
return wrapper;
}