mirror of
https://github.com/codeninjasllc/discourse.git
synced 2024-11-30 19:08:10 -05:00
FIX: Category Logo preview should not repeat
This commit is contained in:
parent
ef0804fbb0
commit
dcdf76a662
3 changed files with 12 additions and 5 deletions
|
@ -1,13 +1,14 @@
|
||||||
|
import property from 'ember-addons/ember-computed-decorators';
|
||||||
import UploadMixin from "discourse/mixins/upload";
|
import UploadMixin from "discourse/mixins/upload";
|
||||||
|
|
||||||
export default Em.Component.extend(UploadMixin, {
|
export default Em.Component.extend(UploadMixin, {
|
||||||
classNames: ["image-uploader"],
|
classNames: ["image-uploader"],
|
||||||
|
|
||||||
backgroundStyle: function() {
|
@property('imageUrl')
|
||||||
const imageUrl = this.get("imageUrl");
|
backgroundStyle(imageUrl) {
|
||||||
if (Em.isNone(imageUrl)) { return; }
|
if (Em.isNone(imageUrl)) { return; }
|
||||||
return ("background-image: url(" + imageUrl + ")").htmlSafe();
|
return `background-image: url(${imageUrl})`.htmlSafe();
|
||||||
}.property("imageUrl"),
|
},
|
||||||
|
|
||||||
uploadDone(upload) {
|
uploadDone(upload) {
|
||||||
this.set("imageUrl", upload.url);
|
this.set("imageUrl", upload.url);
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
<section class='field'>
|
<section class='field'>
|
||||||
<label>{{i18n 'category.logo'}}</label>
|
<label>{{i18n 'category.logo'}}</label>
|
||||||
{{image-uploader imageUrl=category.logo_url type="category_logo"}}
|
{{image-uploader imageUrl=category.logo_url type="category_logo" class="no-repeat"}}
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
<section class='field'>
|
<section class='field'>
|
||||||
|
|
|
@ -2,3 +2,9 @@
|
||||||
background-size: cover;
|
background-size: cover;
|
||||||
background: $primary center center;
|
background: $primary center center;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.image-uploader.no-repeat {
|
||||||
|
.uploaded-image-preview {
|
||||||
|
background-repeat: no-repeat;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in a new issue