mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
FEATURE: Add site setting and wizard step to set base font (#10250)
Co-authored-by: Neil Lalonde <neillalonde@gmail.com>
This commit is contained in:
@@ -52,6 +52,35 @@ const Wizard = EmberObject.extend({
|
||||
}
|
||||
|
||||
return option.data.colors;
|
||||
},
|
||||
|
||||
getCurrentFont(fontId) {
|
||||
const fontsStep = this.steps.findBy("id", "fonts");
|
||||
if (!fontsStep) {
|
||||
return;
|
||||
}
|
||||
|
||||
const fontChoice = fontsStep.get("fieldsById.font_previews");
|
||||
if (!fontChoice) {
|
||||
return;
|
||||
}
|
||||
|
||||
const choiceId = fontId ? fontId : fontChoice.get("value");
|
||||
if (!choiceId) {
|
||||
return;
|
||||
}
|
||||
|
||||
const choices = fontChoice.get("choices");
|
||||
if (!choices) {
|
||||
return;
|
||||
}
|
||||
|
||||
const option = choices.findBy("id", choiceId);
|
||||
if (!option) {
|
||||
return;
|
||||
}
|
||||
|
||||
return option.data.font_stack.split(",")[0];
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user