Wizard: Support for custom image previews for uploads

This commit is contained in:
Robin Ward
2016-09-22 09:52:19 -04:00
parent 28cd49f02b
commit 69325fbe02
4 changed files with 16 additions and 7 deletions
@@ -1,10 +1,17 @@
import computed from 'ember-addons/ember-computed-decorators';
import { getToken } from 'wizard/lib/ajax';
export default Ember.Component.extend({
classNames: ['wizard-image-row'],
uploading: false,
@computed('field.id')
previewComponent(id) {
const componentName = `image-preview-${Ember.String.dasherize(id)}`;
const exists = this.container.lookup(`component:${componentName}`);
return exists ? componentName : 'wizard-image-preview';
},
didInsertElement() {
this._super();
@@ -0,0 +1,3 @@
export default Ember.Component.extend({
classNameBindings: [':wizard-image-preview', 'fieldClass']
});