0
0
Fork 1
Spiegel von https://github.com/paviliondev/discourse-custom-wizard.git synchronisiert 2024-11-30 12:31:10 +01:00
discourse-custom-wizard/assets/javascripts/discourse/routes/admin-wizards-custom.js.es6

28 Zeilen
657 B
Text

2017-09-23 04:34:07 +02:00
import CustomWizard from '../models/custom-wizard';
2020-03-21 18:30:11 +01:00
import DiscourseRoute from "discourse/routes/discourse";
2017-09-23 04:34:07 +02:00
2020-03-21 18:30:11 +01:00
export default DiscourseRoute.extend({
2017-09-23 04:34:07 +02:00
model() {
2017-10-22 05:37:58 +02:00
return CustomWizard.all();
2017-09-23 04:34:07 +02:00
},
2017-10-07 04:27:38 +02:00
afterModel(model) {
const transitionToWizard = this.get('transitionToWizard');
2017-10-13 15:02:34 +02:00
if (transitionToWizard && model.length) {
this.set('transitionToWizard', null);
this.transitionTo('adminWizard', transitionToWizard);
2017-10-07 04:27:38 +02:00
};
2017-10-06 04:59:02 +02:00
},
2017-09-23 04:34:07 +02:00
setupController(controller, model){
controller.set("model", model.toArray());
},
actions: {
2017-10-07 04:27:38 +02:00
refreshAllWizards() {
this.set('transitionToWizard', 'last');
this.refresh();
2017-09-23 04:34:07 +02:00
}
}
});