mirror of
https://github.com/discourse/discourse.git
synced 2024-12-12 09:03:41 +08:00
23 lines
591 B
JavaScript
23 lines
591 B
JavaScript
import Controller from "@ember/controller";
|
|
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.font_previews");
|
|
return fontField.choices.map((choice) => `font-${choice.data.class}`);
|
|
},
|
|
});
|