Ghost/ghost/admin/lib/koenig-editor/addon/components/koenig-plus-menu.hbs
Kevin Ansfield 8b5c18d6e5 Hid email specific cards from card menus when editing pages
no issue

Pages can not be sent by email so by hiding email-specific cards when editing pages we can reduce confusion and clutter.

- added a `@postType` argument to editor components that can be passed through to sub components
- set `@postType` to `post.displayName` which is either `post` or `page`
- updated `{{card-is-available}}` helper to compare a `postType` property on card menu items to the passed in `postType`
2021-09-10 09:24:38 +01:00

18 lines
914 B
Handlebars

{{#if this.showButton}}
<button aria-label="Add a card" class="koenig-plus-menu-button flex justify-center items-center relative w9 h9 ba b--midlightgrey-l2 bg-white br-100 anim-normal" onclick={{action "openMenu"}}>{{svg-jar "plus" class="w4 h4 stroke-middarkgrey i-strokew--2"}}</button>
{{/if}}
{{#if this.showMenu}}
{{!-- TODO: restructure HTML and update kg-style helper to avoid negative margins on divider/title elements --}}
<div class="{{kg-style "cardmenu"}} pa0" role="menu">
{{!-- <div class="koenig-cardmenu-search">
{{svg-jar "koenig/search"}}
<input type="text" placeholder="Search for a card..." class="gh-input koenig-cardmenu-search-input">
</div> --}}
<KoenigMenuContent
@itemSections={{this.itemSections}}
@itemClicked={{action "itemClicked"}}
@postType={{@postType}}
/>
</div>
{{/if}}