mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-24 11:22:19 +03:00
1133370568
refs https://github.com/TryGhost/Ghost/issues/9623 - move click handler registration from `onEnterEdit` to `onSelect` - add guard against deselecting for clicks on the editor canvas - prevents card being deselected when the click would have placed the cursor in a position that selected the card - requires editor instance to be passed through to `{{koenig-card}}` in all card components
25 lines
772 B
Handlebars
25 lines
772 B
Handlebars
{{#koenig-card
|
|
icon="koenig/card-indicator-html"
|
|
class=(concat (kg-style "container-card") " mih10 miw-100 relative")
|
|
headerOffset=headerOffset
|
|
toolbar=toolbar
|
|
isSelected=isSelected
|
|
isEditing=isEditing
|
|
selectCard=(action selectCard)
|
|
deselectCard=(action deselectCard)
|
|
editCard=(action editCard)
|
|
onLeaveEdit=(action "leaveEditMode")
|
|
editor=editor
|
|
}}
|
|
{{#if isEditing}}
|
|
{{gh-cm-editor payload.html
|
|
class="koenig-card-html--editor"
|
|
autofocus=true
|
|
lineWrapping=true
|
|
update=(action "updateHtml")
|
|
}}
|
|
{{else}}
|
|
<div class="koenig-card-html-rendered">{{{payload.html}}}</div>
|
|
<div class="koenig-card-click-overlay"></div>
|
|
{{/if}}
|
|
{{/koenig-card}} |