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