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/discourse/routes/admin-wizards-custom.js.es6

26 Zeilen
560 B
Text

2017-09-23 04:34:07 +02:00
import CustomWizard from '../models/custom-wizard';
export default Discourse.Route.extend({
model() {
return CustomWizard.findAll();
},
2017-10-06 04:59:02 +02:00
afterModel(model, transition) {
if (transition.intent.name !== 'adminWizard' && model.length > 0) {
this.transitionTo('adminWizard', model[0].id);
}
},
2017-09-23 04:34:07 +02:00
setupController(controller, model){
controller.set("model", model.toArray());
},
actions: {
willTransition(transition) {
if (transition.intent.name === 'adminWizardsCustom') {
this.refresh();
}
}
}
});