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

21 lines
473 B
Plaintext
Raw Normal View History

import getUrl from 'discourse-common/lib/get-url';
export default Ember.Controller.extend({
2016-08-26 01:14:56 +08:00
wizard: null,
step: null,
2016-08-26 01:14:56 +08:00
actions: {
2016-09-08 06:04:01 +08:00
goNext(response) {
const next = this.get('step.next');
if (response.refresh_required) {
document.location = getUrl(`/wizard/steps/${next}`);
2016-09-08 06:04:01 +08:00
} else {
this.transitionToRoute('step', next);
}
2016-08-26 01:14:56 +08:00
},
goBack() {
this.transitionToRoute('step', this.get('step.previous'));
},
}
});