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:
@@ -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;
|
||||
}
|
||||
|
Reference in New Issue
Block a user