mirror of
https://github.com/discourse/discourse.git
synced 2026-08-11 05:25:16 -05:00
Wizard: Support for custom image previews for uploads
This commit is contained in:
@@ -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']
|
||||
});
|
||||
Reference in New Issue
Block a user