discourse/app/assets/javascripts/wizard/controllers/application.js
Penar Musaraj a4356b99af
FEATURE: Separate base and heading font site_settings (#10807)
Allows site administrators to pick different fonts for headings in the wizard and in their site settings. Also correctly displays the header logos in wizard previews.
2020-10-05 13:40:41 -04:00

26 lines
650 B
JavaScript

import Controller from "@ember/controller";
import { dasherize } from "@ember/string";
import discourseComputed from "discourse-common/utils/decorators";
export default Controller.extend({
currentStepId: null,
@discourseComputed("currentStepId")
showCanvas(currentStepId) {
return currentStepId === "finished";
},
@discourseComputed("model")
fontClasses(model) {
const fontsStep = model.steps.findBy("id", "fonts");
if (!fontsStep) {
return [];
}
const fontField = fontsStep.get("fieldsById.body_font");
return fontField.choices.map(
(choice) => `body-font-${dasherize(choice.id)}`
);
},
});