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

17 lines
428 B
Plaintext
Raw Normal View History

export default Ember.Route.extend({
model(params) {
2018-06-15 23:03:24 +08:00
const allSteps = this.modelFor("application").steps;
const step = allSteps.findBy("id", params.step_id);
return step ? step : allSteps[0];
},
2016-08-26 01:14:56 +08:00
setupController(controller, step) {
2018-06-15 23:03:24 +08:00
this.controllerFor("application").set("currentStepId", step.get("id"));
2016-08-26 01:14:56 +08:00
controller.setProperties({
2018-06-15 23:03:24 +08:00
step,
wizard: this.modelFor("application")
2016-08-26 01:14:56 +08:00
});
}
});