0
0
Fork 1
Spiegel von https://github.com/paviliondev/discourse-custom-wizard.git synchronisiert 2024-11-14 13:52:54 +01:00
discourse-custom-wizard/assets/javascripts/wizard/routes/custom.js.es6
Angus McLeod f6251ace06 various
2017-10-22 11:37:58 +08:00

29 Zeilen
736 B
JavaScript

import { findCustomWizard } from '../models/custom';
import { ajax } from 'wizard/lib/ajax';
export default Ember.Route.extend({
model(params) {
return findCustomWizard(params.wizard_id);
},
afterModel() {
return ajax({
url: `/site/settings`,
type: 'GET',
}).then((result) => {
Object.assign(Wizard.SiteSettings, result);
});
},
setupController(controller, model) {
const background = model ? model.get('background') : 'AliceBlue';
Ember.run.scheduleOnce('afterRender', this, function(){
$('body.custom-wizard').css('background', background);
});
controller.setProperties({
customWizard: true,
logoUrl: Wizard.SiteSettings.logo_small_url
});
}
});