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

Failed to ignore revisions in .git-blame-ignore-revs.

18 lines
464 B
JavaScript
Raw Normal View History

import Route from "@ember/routing/route";
export default Route.extend({
model(params) {
2018-06-15 11:03:24 -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) {
2018-06-15 11:03:24 -04:00
this.controllerFor("application").set("currentStepId", step.get("id"));
2016-08-25 13:14:56 -04:00
controller.setProperties({
2018-06-15 11:03:24 -04:00
step,
wizard: this.modelFor("application")
2016-08-25 13:14:56 -04:00
});
}
});