FIX: Image uploading component was missing a class

This commit is contained in:
Robin Ward 2015-05-15 11:12:19 -04:00
parent 0362c50698
commit 5148c48170
2 changed files with 5 additions and 4 deletions

View File

@ -1,12 +1,13 @@
import UploadMixin from 'discourse/mixins/upload';
export default Em.Component.extend(UploadMixin, {
classNames: ['image-uploader'],
backgroundStyle: function() {
var imageUrl = this.get('imageUrl');
const imageUrl = this.get('imageUrl');
if (Em.isNone(imageUrl)) { return; }
return "background-image: url(" + imageUrl + ")";
return ("background-image: url(" + imageUrl + ")").htmlSafe();
}.property('imageUrl'),
uploadDone: function(data) {
@ -14,7 +15,7 @@ export default Em.Component.extend(UploadMixin, {
},
actions: {
trash: function() {
trash() {
this.set('imageUrl', null);
// Do we want to signal the delete to the server right away?

View File

@ -1,4 +1,4 @@
<div class="uploaded-image-preview" class="input-xxlarge" {{bind-attr style="backgroundStyle"}}>
<div class="uploaded-image-preview input-xxlarge" style={{backgroundStyle}}>
<div class="image-upload-controls">
<label class="btn pad-left no-text {{if uploading 'disabled'}}">
{{fa-icon "picture-o"}}