1
0
Fork 0
discourse-custom-wizard-unl.../assets/javascripts/discourse/components/wizard-custom-step.js.es6
2017-09-24 11:01:18 +08:00

24 Zeilen
559 B
JavaScript

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());
},
removeField(field) {
this.get('step.fields').removeObject(field);
}
}
});