1
0
Fork 0
discourse-custom-wizard-unl.../assets/javascripts/discourse/routes/admin-wizards-custom.js.es6
Angus McLeod 9f40821db0 Various
2017-10-06 10:59:02 +08:00

25 Zeilen
560 B
JavaScript

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