2019-10-23 13:06:54 -04:00
|
|
|
import Controller from "@ember/controller";
|
2020-10-05 13:40:41 -04:00
|
|
|
import { dasherize } from "@ember/string";
|
2019-11-07 16:38:28 -05: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 16:38:28 -05:00
|
|
|
@discourseComputed("currentStepId")
|
2016-09-19 16:11:15 -04:00
|
|
|
showCanvas(currentStepId) {
|
|
|
|
return currentStepId === "finished";
|
2020-08-31 06:14:09 -04:00
|
|
|
},
|
|
|
|
|
|
|
|
@discourseComputed("model")
|
|
|
|
fontClasses(model) {
|
|
|
|
const fontsStep = model.steps.findBy("id", "fonts");
|
|
|
|
if (!fontsStep) {
|
|
|
|
return [];
|
|
|
|
}
|
|
|
|
|
2020-10-05 13:40:41 -04:00
|
|
|
const fontField = fontsStep.get("fieldsById.body_font");
|
|
|
|
return fontField.choices.map(
|
|
|
|
(choice) => `body-font-${dasherize(choice.id)}`
|
|
|
|
);
|
2016-09-19 16:11:15 -04:00
|
|
|
},
|
|
|
|
});
|