0
0
Fork 1
Spiegel von https://github.com/paviliondev/discourse-custom-wizard.git synchronisiert 2024-11-10 12:22:54 +01:00
discourse-custom-wizard/assets/javascripts/wizard/controllers/custom-step.js.es6
Angus McLeod e859e3efa2 various
2017-10-13 21:02:34 +08:00

24 Zeilen
626 B
JavaScript

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');
document.location = getUrl(`/w/${id}/steps/${next}`);
} else {
this.transitionToRoute('custom.step', next);
}
},
goBack() {
this.transitionToRoute('custom.step', this.get('step.previous'));
},
showMessage(message) {
this.set('stepMessage', message);
}
}
});