Ghost/ghost/admin/lib/koenig-editor/addon/templates/components/koenig-card.hbs
Kevin Ansfield 2e4990093f Koenig - Generic {{koenig-card}} container card component
refs https://github.com/TryGhost/Ghost/issues/9311
- initial CSS for container card outline, selection state, toolbar, etc
- adds `{{#koenig-card}}` component to be used inside of component card templates to handle the default card container HTML, mouse interactions, etc
- update `{{koenig-card-markdown}}` to use the new `{{koenig-card}}` component
  - add render/edit mode views
  - focus the textarea when entering edit mode
- updated `{{koenig-editor}}`
  - add <kbd>Cmd+Enter</kbd> command to put a selected card into edit mode
  - when inserting new cards put them into edit mode immediately
  - move edit/select methods out of actions and into normal methods so that timing is easier to reason about
  - skip `cursorDidChange` process when cursor changes as a result of a card selection, fixes issues with `selectCard` being triggered multiple times unexpectedly
2018-02-13 18:00:54 +00:00

15 lines
509 B
Handlebars

<div class="koenig-card-icon">{{inline-svg icon}}</div>
<div class="koenig-card-content">
{{yield}}
</div>
{{#if toolbar}}
<div class="koenig-card-toolbar koenig-toolbar {{if showToolbar "koenig-toolbar--visible"}}" style={{toolbarStyle}}>
{{#each toolbar.items as |item|}}
<button type="button" title={{item.title}} class="koenig-toolbar-btn" onmousedown={{action item.action}}>
{{inline-svg item.icon}}
</button>
{{/each}}
</div>
{{/if}}