Ghost/ghost/admin/app/templates/components/gh-markdown-editor.hbs
Kevin Ansfield e636e58b12 open file dialog and upload images via editor toolbar (#685)
no issue

- adds a hidden file input to the `gh-markdown-editor` component
- when the editor image toolbar button is clicked, capture the current selection (it gets during the file upload), trigger the file dialog then when files are selected initiate the same upload+insert process as drag/drop image uploads
2017-05-10 17:16:36 +02:00

18 lines
533 B
Handlebars

{{yield (hash
editor=(component "gh-simplemde"
value=markdown
placeholder=placeholder
autofocus=autofocus
onChange=(action "updateMarkdown")
onEditorInit=(action "setEditor")
onEditorDestroy=(action "destroyEditor")
options=simpleMDEOptions)
isFullScreen=_isFullScreen
isSplitScreen=_isSplitScreen
focus=(action "focusEditor")
)}}
<div style="display:none">
{{gh-file-input multiple=true action=(action onImageFilesSelected) accept=imageMimeTypes}}
</div>