Spiegel von
https://github.com/paviliondev/discourse-custom-wizard.git
synchronisiert 2024-11-10 04:12:53 +01:00
27 Zeilen
624 B
Text
27 Zeilen
624 B
Text
|
import { default as computed } from 'ember-addons/ember-computed-decorators';
|
||
|
|
||
|
export default Ember.Component.extend({
|
||
|
classNames: 'wizard-custom-step',
|
||
|
|
||
|
@computed('step.fields.@each.id')
|
||
|
allowAddAction(stepFields) {
|
||
|
console.log(stepFields)
|
||
|
return stepFields.get('firstObject.id');
|
||
|
},
|
||
|
|
||
|
actions: {
|
||
|
addField() {
|
||
|
console.log('adding field')
|
||
|
this.get('step.fields').pushObject(Ember.Object.create());
|
||
|
},
|
||
|
|
||
|
addAction() {
|
||
|
this.get('step.actions').pushObject(Ember.Object.create());
|
||
|
},
|
||
|
|
||
|
removeStep() {
|
||
|
this.sendAction('removeStep', this.get('step.name'));
|
||
|
}
|
||
|
}
|
||
|
});
|