1
0
Fork 0
mirror of https://github.com/TryGhost/Ghost-Admin.git synced 2023-12-14 02:33:04 +01:00
Ghost-Admin/app/templates/components/gh-markdown-editor.hbs
Kevin Ansfield 3b6758479c 🐛 Fixed editor crashing when leaving a markdown card's edit mode
no issue
- a change in Ember 3.10's rendering has resulting in the component's element being removed before the `{{gh-markdown-editor}}`'s cleanup action is run which meant that we were trying to run `.querySelector` on `undefined`
- removes the code which moved toolbar elements around because it hasn't been used since we moved to Koenig, this meant that the cleanup action could also be removed
2019-05-23 13:43:01 +01:00

33 lines
889 B
Handlebars

{{yield (hash
editor=(component "gh-simplemde"
value=markdown
placeholder=placeholder
autofocus=autofocus
onChange=(action "updateMarkdown")
onFocus=(action "updateFocusState" true)
onBlur=(action "updateFocusState" false)
onEditorInit=(action "setEditor")
options=simpleMDEOptions)
isFullScreen=_isFullScreen
isSplitScreen=_isSplitScreen
focus=(action "focusEditor")
)}}
<div style="display:none">
{{gh-file-input
multiple=true
action=(action onImageFilesSelected)
accept=imageMimeTypes}}
</div>
{{#if _showUnsplash}}
{{gh-unsplash
select=(action "insertUnsplashPhoto")
close=(action "toggleUnsplash")}}
{{/if}}
{{#if showMarkdownHelp}}
{{gh-fullscreen-modal "markdown-help"
close=(action "toggleMarkdownHelp")
modifier="wide"}}
{{/if}}