ember-mobile-menu icon indicating copy to clipboard operation
ember-mobile-menu copied to clipboard

Add toggle to MobileMenu

Open NullVoxPopuli opened this issue 5 years ago • 1 comments

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 avatar Aug 02 '20 20:08 NullVoxPopuli

@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.

nickschot avatar Aug 03 '20 18:08 nickschot