Ghost/ghost/admin/lib/gh-koenig/addon/templates/components/koenig-plus-menu.hbs
Ryan McCarvill a88b8bc00a 🐝 Card menu fixes (#597)
closes: https://github.com/TryGhost/Ghost/issues/8106

- Fixes the keyboard selection problems of the '+' menu.
- Makes the active state of the keyboard selection blank until a key is pressed.
- Fixes it so that the '+' menu executes the tool on Enter.
2017-03-20 12:40:20 +00:00

27 lines
957 B
Handlebars

{{#if showButton}}
<button class="gh-cardmenu-button" {{action "openMenu"}}>{{inline-svg "plus"}}</button>
{{/if}}
{{#if isOpen}}
<div class="gh-cardmenu">
<div class="gh-cardmenu-search">
{{inline-svg "search.svg"}}
{{gh-input query class="gh-input gh-cardmenu-search-input" placeholder="Search for a card..." type="text" update=(action (mut query))
keyEvents=(hash
27=(action "closeMenu")
13=(action "selectTool")
37=(action "moveSelectionLeft")
38=(action "moveSelectionUp")
39=(action "moveSelectionRight")
40=(action "moveSelectionDown")
)
}}
</div>
<div class="gh-cardmenu-divider">
Primary
</div>
{{#each toolbar as |tool index|}}
{{koenig-menu-item tool=tool editor=editor range=range selected=tool.selected clicked=(action "closeMenu")}}
{{/each}}
</div>
{{/if}}