0
0
Fork 1
Spiegel von https://github.com/paviliondev/discourse-custom-wizard.git synchronisiert 2024-11-12 21:22:54 +01:00
discourse-custom-wizard/assets/javascripts/discourse/components/wizard-custom-step.js.es6

23 Zeilen
586 B
Text

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