custom.js.es6 679 B

12345678910111213141516171819202122232425262728
  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. Ember.run.scheduleOnce('afterRender', this, function(){
  17. $('body.custom-wizard').css('background', model.get('background'));
  18. });
  19. controller.setProperties({
  20. customWizard: true,
  21. logoUrl: Wizard.SiteSettings.logo_small_url
  22. });
  23. }
  24. });