]> BookStack Code Mirror - bookstack/blobdiff - resources/js/wysiwyg/ui/framework/blocks/dropdown-button.ts
Lexical: Added mobile toolbar support
[bookstack] / resources / js / wysiwyg / ui / framework / blocks / dropdown-button.ts
index cba141f6c77a0777eb2dc10b1517b63206930a49..d7f02d5732b96e7d167f40249dd2eb8314d5fb9d 100644 (file)
@@ -7,12 +7,14 @@ import {EditorMenuButton} from "./menu-button";
 export type EditorDropdownButtonOptions = {
     showOnHover?: boolean;
     direction?: 'vertical'|'horizontal';
+    showAside?: boolean;
     button: EditorBasicButtonDefinition|EditorButton;
 };
 
 const defaultOptions: EditorDropdownButtonOptions = {
     showOnHover: false,
     direction: 'horizontal',
+    showAside: undefined,
     button: {label: 'Menu'},
 }
 
@@ -65,6 +67,7 @@ export class EditorDropdownButton extends EditorContainerUiElement {
 
         handleDropdown({toggle: button, menu : menu,
             showOnHover: this.options.showOnHover,
+            showAside: typeof this.options.showAside === 'boolean' ? this.options.showAside : (this.options.direction === 'vertical'),
             onOpen : () => {
             this.open = true;
             this.getContext().manager.triggerStateUpdateForElement(this.button);