diff --git a/app/assets/javascripts/discourse/components/image-uploader.js.es6 b/app/assets/javascripts/discourse/components/image-uploader.js.es6 index 4ca6bfdab22..3fc6650a47e 100644 --- a/app/assets/javascripts/discourse/components/image-uploader.js.es6 +++ b/app/assets/javascripts/discourse/components/image-uploader.js.es6 @@ -1,13 +1,14 @@ +import property from 'ember-addons/ember-computed-decorators'; import UploadMixin from "discourse/mixins/upload"; export default Em.Component.extend(UploadMixin, { classNames: ["image-uploader"], - backgroundStyle: function() { - const imageUrl = this.get("imageUrl"); + @property('imageUrl') + backgroundStyle(imageUrl) { if (Em.isNone(imageUrl)) { return; } - return ("background-image: url(" + imageUrl + ")").htmlSafe(); - }.property("imageUrl"), + return `background-image: url(${imageUrl})`.htmlSafe(); + }, uploadDone(upload) { this.set("imageUrl", upload.url); diff --git a/app/assets/javascripts/discourse/templates/components/edit-category-images.hbs b/app/assets/javascripts/discourse/templates/components/edit-category-images.hbs index f4d7995dfdc..84139b501d4 100644 --- a/app/assets/javascripts/discourse/templates/components/edit-category-images.hbs +++ b/app/assets/javascripts/discourse/templates/components/edit-category-images.hbs @@ -1,6 +1,6 @@
- {{image-uploader imageUrl=category.logo_url type="category_logo"}} + {{image-uploader imageUrl=category.logo_url type="category_logo" class="no-repeat"}}
diff --git a/app/assets/stylesheets/common/base/upload.scss b/app/assets/stylesheets/common/base/upload.scss index 6afba003ef1..9777fd32046 100644 --- a/app/assets/stylesheets/common/base/upload.scss +++ b/app/assets/stylesheets/common/base/upload.scss @@ -2,3 +2,9 @@ background-size: cover; background: $primary center center; } + +.image-uploader.no-repeat { + .uploaded-image-preview { + background-repeat: no-repeat; + } +}