admin-wizards-custom.js.es6 601 B

1234567891011121314151617181920212223242526
  1. import CustomWizard from '../models/custom-wizard';
  2. export default Discourse.Route.extend({
  3. model() {
  4. return CustomWizard.all();
  5. },
  6. afterModel(model) {
  7. const transitionToWizard = this.get('transitionToWizard');
  8. if (transitionToWizard && model.length) {
  9. this.set('transitionToWizard', null);
  10. this.transitionTo('adminWizard', transitionToWizard);
  11. };
  12. },
  13. setupController(controller, model){
  14. controller.set("model", model.toArray());
  15. },
  16. actions: {
  17. refreshAllWizards() {
  18. this.set('transitionToWizard', 'last');
  19. this.refresh();
  20. }
  21. }
  22. });