1
0
Fork 0
discourse-custom-wizard-unl.../assets/javascripts/wizard/controllers/custom-step.js.es6

25 Zeilen
629 B
Text

import StepController from 'wizard/controllers/step';
import getUrl from 'discourse-common/lib/get-url';
export default StepController.extend({
actions: {
goNext(response) {
const next = this.get('step.next');
if (response.refresh_required) {
const id = this.get('wizard.id');
2017-10-17 15:17:53 +02:00
window.location.href = getUrl(`/w/${id}/steps/${next}`);
} else {
this.transitionToRoute('custom.step', next);
}
},
goBack() {
this.transitionToRoute('custom.step', this.get('step.previous'));
2017-10-13 15:02:34 +02:00
},
showMessage(message) {
this.set('stepMessage', message);
}
}
});