0
0
Fork 1
Spiegel von https://github.com/paviliondev/discourse-custom-wizard.git synchronisiert 2024-11-10 04:12:53 +01:00
discourse-custom-wizard/assets/javascripts/wizard/routes/custom.js.es6
Angus McLeod cf50a7deb3
Apply prettier 💄 (#80)
* Apply prettier

* applied prettier for similar-topics-validator

Co-authored-by: Faizaan Gagan <fzngagan@gmail.com>
2021-03-28 14:36:49 +05:30

39 Zeilen
994 B
JavaScript

/* eslint no-undef: 0 */
import { findCustomWizard } from "../models/custom";
import { ajax } from "wizard/lib/ajax";
export default Ember.Route.extend({
beforeModel(transition) {
this.set("queryParams", transition.intent.queryParams);
},
model(params) {
return findCustomWizard(params.wizard_id, this.get("queryParams"));
},
afterModel() {
return ajax({
url: `/site/settings`,
type: "GET",
}).then((result) => {
$.extend(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);
if (model) {
$("#custom-wizard-main").addClass(model.get("id").dasherize());
}
});
controller.setProperties({
customWizard: true,
logoUrl: Wizard.SiteSettings.logo_small,
reset: null,
});
},
});