custom.js.es6 806 B

123456789101112131415161718192021222324252627282930
  1. import { findCustomWizard } from '../models/custom';
  2. import { ajax } from 'wizard/lib/ajax';
  3. export default Ember.Route.extend({
  4. model(params) {
  5. return findCustomWizard(params.wizard_id);
  6. },
  7. afterModel() {
  8. return ajax({
  9. url: `/site/settings`,
  10. type: 'GET',
  11. }).then((result) => {
  12. Object.assign(Wizard.SiteSettings, result);
  13. });
  14. },
  15. setupController(controller, model) {
  16. const background = model ? model.get('background') : 'AliceBlue';
  17. Ember.run.scheduleOnce('afterRender', this, function(){
  18. $('body.custom-wizard').css('background', background);
  19. $('#custom-wizard-main').addClass(model.get('id').dasherize());
  20. });
  21. controller.setProperties({
  22. customWizard: true,
  23. logoUrl: Wizard.SiteSettings.logo_small_url
  24. });
  25. }
  26. });