diff --git a/ghost/admin/app/components/gh-image-uploader.js b/ghost/admin/app/components/gh-image-uploader.js index 62135fe111..d5ec51113a 100644 --- a/ghost/admin/app/components/gh-image-uploader.js +++ b/ghost/admin/app/components/gh-image-uploader.js @@ -30,7 +30,7 @@ export default Component.extend({ text: '', altText: '', saveButton: true, - accept: null, + accept: '', extensions: null, uploadUrl: null, validate: null, @@ -85,9 +85,8 @@ export default Component.extend({ return htmlSafe(`width: ${width}`); }), - didReceiveAttrs() { - let image = this.get('image'); - this.set('url', image); + init() { + this._super(...arguments); if (!this.get('accept')) { this.set('accept', this.get('_defaultAccept')); @@ -100,6 +99,11 @@ export default Component.extend({ } }, + didReceiveAttrs() { + let image = this.get('image'); + this.set('url', image); + }, + actions: { fileSelected(fileList, resetInput) { // can't use array destructuring here as FileList is not a strict