diff --git a/src/public/app/widgets/type_widgets/options/text_notes/heading_style.ts b/src/public/app/widgets/type_widgets/options/text_notes/heading_style.ts index 828946544..0aa89c744 100644 --- a/src/public/app/widgets/type_widgets/options/text_notes/heading_style.ts +++ b/src/public/app/widgets/type_widgets/options/text_notes/heading_style.ts @@ -6,24 +6,33 @@ const TPL = `

${t("heading_style.title")}

- +
+ + + + + +
`; export default class HeadingStyleOptions extends OptionsWidget { private $body!: JQuery; - private $headingStyle!: JQuery; doRender() { this.$widget = $(TPL); this.$body = $("body"); - this.$headingStyle = this.$widget.find(".heading-style"); - this.$headingStyle.on("change", () => { - const newHeadingStyle = String(this.$headingStyle.val()); + this.$widget.find(`input[name="heading-style"]`).on("change", () => { + const newHeadingStyle = String(this.$widget.find(`input[name="heading-style"]:checked`).val()); this.toggleBodyClass("heading-style-", newHeadingStyle); @@ -32,7 +41,8 @@ export default class HeadingStyleOptions extends OptionsWidget { } async optionsLoaded(options: OptionMap) { - this.$headingStyle.val(options.headingStyle); + this.$widget.find(`input[name="heading-style"][value="${options.headingStyle}"]`) + .prop("checked", "true"); } toggleBodyClass(prefix: string, value: string) {