Ghost/ghost/admin/lib/koenig-editor/addon/templates/components/koenig-card-code.hbs
Kevin Ansfield 0d08c639fe 🐛 Fixed editor undo states for card contents (#1064)
refs https://github.com/TryGhost/Ghost/issues/10049
- update `{{koenig-card}}` component to compare payload values and create a snapshot when exiting edit mode for container cards (markdown, html, code)
- update image card to trigger snapshots on image upload/selection and width change
2018-11-06 14:43:19 +00:00

28 lines
952 B
Handlebars

{{#koenig-card
class=(concat "ba b--white relative kg-card-hover miw-100 relative" (if isEditing "pt1 pb1 pl6 nl6 pr6 nr6"))
headerOffset=headerOffset
toolbar=toolbar
payload=payload
isSelected=isSelected
isEditing=isEditing
selectCard=(action selectCard)
deselectCard=(action deselectCard)
editCard=(action editCard)
saveCard=(action saveCard)
onLeaveEdit=(action "leaveEditMode")
editor=editor
}}
{{#if isEditing}}
{{gh-cm-editor payload.code
class="koenig-card-html--editor"
autofocus=true
lineWrapping=true
update=(action "updateCode")
}}
{{else}}
<div class="koenig-card-html-rendered">
<pre><code class="line-numbers {{if payload.language (concat "language-" payload.language)}}">{{escapedCode}}</code></pre>
</div>
<div class="koenig-card-click-overlay"></div>
{{/if}}
{{/koenig-card}}