mirror of
https://github.com/discourse/discourse.git
synced 2024-11-25 09:42:07 +08:00
a4356b99af
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.
26 lines
650 B
JavaScript
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)}`
|
|
);
|
|
},
|
|
});
|