mirror of
https://github.com/discourse/discourse.git
synced 2024-11-23 06:04:11 +08:00
FIX: Category Logo preview should not repeat
This commit is contained in:
parent
ef0804fbb0
commit
dcdf76a662
|
@ -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);
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<section class='field'>
|
||||
<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 class='field'>
|
||||
|
|
|
@ -2,3 +2,9 @@
|
|||
background-size: cover;
|
||||
background: $primary center center;
|
||||
}
|
||||
|
||||
.image-uploader.no-repeat {
|
||||
.uploaded-image-preview {
|
||||
background-repeat: no-repeat;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user