0
0
Fork 1
Spiegel von https://github.com/paviliondev/discourse-custom-wizard.git synchronisiert 2024-11-29 12:20:27 +01:00
discourse-custom-wizard/assets/javascripts/discourse/routes/admin-wizards-custom.js.es6
2020-03-22 04:30:11 +11:00

27 Zeilen
657 B
JavaScript

import CustomWizard from '../models/custom-wizard';
import DiscourseRoute from "discourse/routes/discourse";
export default DiscourseRoute.extend({
model() {
return CustomWizard.all();
},
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();
}
}
});