wizard-custom-step.js.es6 559 B

123456789101112131415161718192021222324
  1. import { default as computed } from 'ember-addons/ember-computed-decorators';
  2. export default Ember.Component.extend({
  3. classNames: 'wizard-custom-step',
  4. @computed('step.fields.@each.id')
  5. allowAddAction(stepFields) {
  6. return stepFields.get('firstObject.id');
  7. },
  8. actions: {
  9. addField() {
  10. this.get('step.fields').pushObject(Ember.Object.create());
  11. },
  12. addAction() {
  13. this.get('step.actions').pushObject(Ember.Object.create());
  14. },
  15. removeField(field) {
  16. this.get('step.fields').removeObject(field);
  17. }
  18. }
  19. });