Spiegel von
https://github.com/paviliondev/discourse-custom-wizard.git
synchronisiert 2024-11-26 11:00:28 +01:00
26 Zeilen
717 B
JavaScript
26 Zeilen
717 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.route_to) {
|
|
window.location.href = response.route_to;
|
|
} else if (response.refresh_required) {
|
|
const id = this.get('wizard.id');
|
|
window.location.href = 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);
|
|
}
|
|
}
|
|
});
|