2017-09-23 04:34:07 +02:00
|
|
|
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) {
|
|
|
|
return stepFields.get('firstObject.id');
|
|
|
|
},
|
|
|
|
|
|
|
|
actions: {
|
|
|
|
addField() {
|
|
|
|
this.get('step.fields').pushObject(Ember.Object.create());
|
|
|
|
},
|
|
|
|
|
|
|
|
addAction() {
|
|
|
|
this.get('step.actions').pushObject(Ember.Object.create());
|
|
|
|
},
|
|
|
|
|
2017-09-24 05:01:18 +02:00
|
|
|
removeField(field) {
|
|
|
|
this.get('step.fields').removeObject(field);
|
2017-09-23 04:34:07 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|