1
0
Fork 0
mirror of https://github.com/TryGhost/Ghost-Admin.git synced 2023-12-14 02:33:04 +01:00
Ghost-Admin/lib/koenig-editor/addon/templates/components/koenig-editor.hbs
Kevin Ansfield 23e6173017
Koenig - Sticky card icons (#1013)
refs https://github.com/TryGhost/Ghost/issues/9505
- use `ember-sticky-element` to stick card icons in top left when scrolling
- pass an `headerOffset` down from the `{{gh-editor}}` component through Koenig and the card components so that it can be used for adjustments where necessary
    - calculate `headerHeight` in `{{gh-editor}}` any time we change the header class
2018-05-01 15:55:51 +01:00

77 lines
2.4 KiB
Handlebars

<div class="koenig-editor__editor-wrapper">
<div class="koenig-editor__editor"></div>
</div>
{{!-- pop-up markup toolbar is shown when there's a selection --}}
{{koenig-toolbar
editor=editor
editorRange=selectedRange
activeMarkupTagNames=activeMarkupTagNames
activeSectionTagNames=activeSectionTagNames
toggleMarkup=(action "toggleMarkup")
toggleSection=(action "toggleSection")
editLink=(action "editLink")
}}
{{!-- pop-up link hover toolbar --}}
{{koenig-link-toolbar
editor=editor
container=element
linkRange=linkRange
selectedRange=selectedRange
editLink=(action "editLink")
}}
{{!-- pop-up link editing toolbar --}}
{{#if linkRange}}
{{koenig-link-input
editor=editor
linkRange=linkRange
selectedRange=selectedRange
cancel=(action "cancelEditLink")
}}
{{/if}}
{{!-- (+) icon and pop-up menu --}}
{{koenig-plus-menu
editor=editor
editorRange=selectedRange
replaceWithCardSection=(action "replaceWithCardSection")
}}
{{!-- slash menu popup --}}
{{koenig-slash-menu
editor=editor
editorRange=selectedRange
replaceWithCardSection=(action "replaceWithCardSection")
}}
{{!-- all component cards wormholed into the editor canvas --}}
{{#each componentCards as |card|}}
{{!--
TODO: move to the public {{in-element}} API when it's available
https://github.com/cibernox/rfcs/blob/make-in-element-public/text/0000-promote-in-element-to-public-api.md
--}}
{{#-in-element card.destinationElement}}
{{component card.componentName
editor=editor
postModel=card.postModel
cardName=card.cardName
payload=card.payload
env=card.env
options=card.options
headerOffset=headerOffset
saveCard=(action card.env.save)
cancelCard=(action card.env.cancel)
removeCard=(action card.env.remove)
isSelected=card.isSelected
selectCard=(action "selectCard" card)
isEditing=card.isEditing
editCard=(action "editCard" card)
deleteCard=(action "deleteCard" card)
moveCursorToPrevSection=(action "moveCursorToPrevSection" card)
moveCursorToNextSection=(action "moveCursorToNextSection" card)
addParagraphAfterCard=(action "addParagraphAfterCard" card)
}}
{{/-in-element}}
{{/each}}