mirror of
https://github.com/discourse/discourse.git
synced 2024-12-15 09:03:40 +08:00
FIX: Category Logo preview should not repeat
This commit is contained in:
parent
931812ce69
commit
7a155710dd
|
@ -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 New Issue
Block a user