mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-28 21:33:24 +03:00
02b57750cf
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
15 lines
516 B
Handlebars
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}}
|