ember-mobile-menu
ember-mobile-menu copied to clipboard
Add toggle to MobileMenu
Use case: keyboard shortcuts! :D
<MobileMenuWrapper @openDetectonWidth={{30}} as |mmw|>
{{#if this.currentUser.isLoggedIn}}
<mmw.MobileMenu
@isOpen={{this.sidebar.isOpen}}
@onToggle={{this.sidebar.toggle}}
as |mm|>
<App::Sidebar
class='sidebar-wrapper'
id='sidebar'
{{on-key 'ctrl+space' this.sidebar.toggle}}
/>
</mmw.MobileMenu>
{{/if}}
<mmw.Content>
{{yield}}
</mmw.Content>
</MobileMenuWrapper>
@NullVoxPopuli this current implementation will unfortunately not work as openOrClose does not function as a toggle action, it requires an argument which states whether the menu should open or not. We could pass that in with an if statement or create a separate toggle action.