Ghost/ghost/admin/lib/koenig-editor/addon/templates/components/koenig-card.hbs
Kevin Ansfield 5d552202f6 Koenig - Image card
refs https://github.com/TryGhost/Ghost/issues/9311
- add actions for cursor movement and pass through to card components
    - `moveCursorToNextSection` deselects card and places cursor at beginning of next section, useful for caption inputs where <kbd>down arrow</kbd> or <kbd>right arrow</kbd> should move the cursor out of the input & card. Also creates an empty paragraph before moving the cursor if for some reason an empty paragraph doesn't exist after the last card in the doc
    - `moveCursorToPrevSection` deselects card and places cursor at end of previous section, useful for caption inputs where <kbd>up arrow</kbd> or <kbd>left arrow</kbd> should move the cursor out of the input & card
    - `addParagraphAfterCard` deselects card, creates a new paragraph after the card and moves the cursor to it. Useful for caption inputs where <kbd>enter</kbd> should have the same behaviour as if it was pressed whilst the card is selected
- modify `{{gh-uploader}}` so that it passes the FileList to it's `onStart` closure action. Useful for displaying previews when uploading images
- modify `{{koenig-card}}` toolbar display so that it can display text as well as icon buttons
- update `{{koenig-card-image}}` so that it has a full image uploader and caption input
2018-02-22 20:41:40 +00:00

24 lines
724 B
Handlebars

{{#if icon}}{{inline-svg icon class=iconClass}}{{/if}}
{{yield}}
{{#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 sans-serif f7"
style="width: auto !important"
onmousedown={{action item.action}}
>
{{#if item.icon}}
{{inline-svg item.icon}}
{{else}}
{{item.title}}
{{/if}}
</button>
{{/each}}
</div>
{{/if}}