1
0
Fork 0
discourse-custom-wizard-unl.../assets/javascripts/discourse/routes/admin-wizards-custom.js.es6
Angus McLeod e859e3efa2 various
2017-10-13 21:02:34 +08:00

26 Zeilen
605 B
JavaScript

import CustomWizard from '../models/custom-wizard';
export default Discourse.Route.extend({
model() {
return CustomWizard.findAll();
},
afterModel(model) {
const transitionToWizard = this.get('transitionToWizard');
if (transitionToWizard && model.length) {
this.set('transitionToWizard', null);
this.transitionTo('adminWizard', transitionToWizard);
};
},
setupController(controller, model){
controller.set("model", model.toArray());
},
actions: {
refreshAllWizards() {
this.set('transitionToWizard', 'last');
this.refresh();
}
}
});