discourse/app/assets/javascripts/wizard/routes/step.js.es6

16 lines
422 B
Plaintext
Raw Normal View History

export default Ember.Route.extend({
model(params) {
2016-08-25 13:14:56 -04:00
const allSteps = this.modelFor('application').steps;
const step = allSteps.findBy('id', params.step_id);
return step ? step : allSteps[0];
},
2016-08-25 13:14:56 -04:00
setupController(controller, step) {
this.controllerFor('application').set('currentStepId', step.get('id'));
2016-08-25 13:14:56 -04:00
controller.setProperties({
step, wizard: this.modelFor('application')
});
}
});