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

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

18 lines
464 B
JavaScript
Raw Normal View History

import Route from "@ember/routing/route";
export default Route.extend({
model(params) {
2016-08-26 01:14:56 +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) {
this.controllerFor("application").set("currentStepId", step.get("id"));
2016-08-26 01:14:56 +08:00
controller.setProperties({
step,
wizard: this.modelFor("application")
});
}
});