Ghost/ghost/admin/app/templates/components/gh-ed-preview.hbs
Kevin Ansfield 02b57750cf Fix editor image perf and upload bug
no issue
- ~10x speedup in processing time taken on each keypress when there are many images/image upload components in the editor
  - edit DOM in memory before changing it in the page to avoid double-render
  - keep upload components around and re-assign them on re-render, adding or removing an image will still re-generate everything
- adds a throttle to the preview rendering so that renders don't get queued up
- fixes occasional bug where uploading an image didn't update the markdown correctly due to a timing issue
2016-05-08 12:55:56 +02:00

15 lines
516 B
Handlebars

{{previewHTML}}
{{#each imageUploadComponents as |uploader|}}
{{#ember-wormhole to=uploader.destinationElementId}}
{{gh-image-uploader-with-preview
image=uploader.src
text="Upload an image"
update=(action "updateImageSrc" uploader.index)
remove=(action "updateImageSrc" uploader.index "")
uploadStarted=uploadStarted
uploadFinished=uploadFinished
formChanged=(action "updateHeight")}}
{{/ember-wormhole}}
{{/each}}