2018-06-15 23:03:24 +08:00
|
|
|
import getUrl from "discourse-common/lib/get-url";
|
2016-09-23 02:39:36 +08:00
|
|
|
|
2016-08-25 02:35:07 +08:00
|
|
|
export default Ember.Controller.extend({
|
2016-08-26 01:14:56 +08:00
|
|
|
wizard: null,
|
2016-08-25 02:35:07 +08:00
|
|
|
step: null,
|
2016-08-26 01:14:56 +08:00
|
|
|
|
|
|
|
actions: {
|
2016-09-08 06:04:01 +08:00
|
|
|
goNext(response) {
|
2018-06-15 23:03:24 +08:00
|
|
|
const next = this.get("step.next");
|
2016-09-08 06:04:01 +08:00
|
|
|
if (response.refresh_required) {
|
2016-09-23 02:39:36 +08:00
|
|
|
document.location = getUrl(`/wizard/steps/${next}`);
|
2016-09-08 06:04:01 +08:00
|
|
|
} else {
|
2018-06-15 23:03:24 +08:00
|
|
|
this.transitionToRoute("step", next);
|
2016-09-08 06:04:01 +08:00
|
|
|
}
|
2016-08-26 01:14:56 +08:00
|
|
|
},
|
|
|
|
goBack() {
|
2018-06-15 23:03:24 +08:00
|
|
|
this.transitionToRoute("step", this.get("step.previous"));
|
|
|
|
}
|
2016-08-26 01:14:56 +08:00
|
|
|
}
|
2016-08-25 02:35:07 +08:00
|
|
|
});
|