1
0
Fork 0
discourse-custom-wizard-unl.../assets/javascripts/discourse/routes/admin-wizards-custom.js.es6

26 Zeilen
580 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-07 04:27:38 +02:00
afterModel(model) {
const transitionToWizard = this.get('transitionToWizard');
if (transitionToWizard === 'last' && model.length) {
this.transitionTo('adminWizard', model[model.length - 1].id);
};
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
}
}
});