2019-10-24 01:06:54 +08:00
|
|
|
import Controller from "@ember/controller";
|
2019-11-08 05:38:28 +08:00
|
|
|
import discourseComputed from "discourse-common/utils/decorators";
|
2016-09-20 04:11:15 +08:00
|
|
|
|
2019-10-24 01:06:54 +08:00
|
|
|
export default Controller.extend({
|
2016-09-20 04:11:15 +08:00
|
|
|
currentStepId: null,
|
|
|
|
|
2019-11-08 05:38:28 +08:00
|
|
|
@discourseComputed("currentStepId")
|
2016-09-20 04:11:15 +08:00
|
|
|
showCanvas(currentStepId) {
|
|
|
|
return currentStepId === "finished";
|
2020-08-31 18:14:09 +08:00
|
|
|
},
|
|
|
|
|
|
|
|
@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}`);
|
2016-09-20 04:11:15 +08:00
|
|
|
},
|
|
|
|
});
|