diff --git a/app/assets/javascripts/discourse/components/image-uploader.js.es6 b/app/assets/javascripts/discourse/components/image-uploader.js.es6 index 234de6e8434..ec52913c99f 100644 --- a/app/assets/javascripts/discourse/components/image-uploader.js.es6 +++ b/app/assets/javascripts/discourse/components/image-uploader.js.es6 @@ -35,10 +35,16 @@ export default Ember.Component.extend(UploadMixin, { }, @computed("imageUrl") - backgroundStyle(url) { + imageCDNURL(url) { if (Ember.isEmpty(url)) { return "".htmlSafe(); } + + return Discourse.getURLWithCDN(url); + }, + + @computed("imageCDNURL") + backgroundStyle(url) { return `background-image: url(${url})`.htmlSafe(); }, diff --git a/app/assets/javascripts/discourse/templates/components/image-uploader.hbs b/app/assets/javascripts/discourse/templates/components/image-uploader.hbs index 716f4c646a6..4c9b410290d 100644 --- a/app/assets/javascripts/discourse/templates/components/image-uploader.hbs +++ b/app/assets/javascripts/discourse/templates/components/image-uploader.hbs @@ -26,7 +26,7 @@ {{#if imageUrl}}