wizard-custom-step.js.es6 524 B

123456789101112131415161718
  1. import { observes } from 'ember-addons/ember-computed-decorators';
  2. export default Ember.Component.extend({
  3. classNames: 'wizard-custom-step',
  4. currentField: null,
  5. currentAction: null,
  6. disableId: Ember.computed.not('step.isNew'),
  7. @observes('step')
  8. resetCurrentObjects() {
  9. const fields = this.get('step.fields');
  10. const actions = this.get('step.actions');
  11. this.setProperties({
  12. currentField: fields.length ? fields[0] : null,
  13. currentAction: actions.length ? actions[0] : null
  14. });
  15. }
  16. });