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

@@ -20,7 +20,7 @@ export class EditorFormatMenu extends EditorContainerUiElement {
class: 'editor-format-menu editor-dropdown-menu-container',
}, [toggle, menu]);
handleDropdown(toggle, menu);
handleDropdown({toggle : toggle, menu : menu});
return wrapper;
}
@@ -33,6 +33,15 @@ export class EditorFormatMenu extends EditorContainerUiElement {
this.updateToggleLabel(child.getLabel());
return;
}
if (child instanceof EditorContainerUiElement) {
for (const grandchild of child.getChildren()) {
if (grandchild instanceof EditorButton && grandchild.isActive()) {
this.updateToggleLabel(grandchild.getLabel());
return;
}
}
}
}
this.updateToggleLabel(this.trans('Formats'));