diff --git a/src/public/app/widgets/type_widgets/options/appearance/theme.js b/src/public/app/widgets/type_widgets/options/appearance/theme.js index 5948b373f..e9fc04b73 100644 --- a/src/public/app/widgets/type_widgets/options/appearance/theme.js +++ b/src/public/app/widgets/type_widgets/options/appearance/theme.js @@ -5,6 +5,26 @@ import { t } from "../../../../services/i18n.js"; const TPL = `
+ `; export default class ThemeOptions extends OptionsWidget { @@ -27,6 +47,11 @@ export default class ThemeOptions extends OptionsWidget { this.$widget = $(TPL); this.$themeSelect = this.$widget.find(".theme-select"); this.$overrideThemeFonts = this.$widget.find(".override-theme-fonts"); + this.$layoutOrientation = this.$widget.find(`input[name="layout-orientation"]`).on("change", async () => { + const newLayoutOrientation = this.$widget.find(`input[name="layout-orientation"]:checked`).val(); + await this.updateOption("layoutOrientation", newLayoutOrientation); + utils.reloadFrontendApp("layout orientation change"); + }); this.$themeSelect.on('change', async () => { const newTheme = this.$themeSelect.val(); @@ -57,5 +82,8 @@ export default class ThemeOptions extends OptionsWidget { this.$themeSelect.val(options.theme); this.setCheckboxState(this.$overrideThemeFonts, options.overrideThemeFonts); + + this.$widget.find(`input[name="layout-orientation"][value="${options.layoutOrientation}"]`) + .prop("checked", "true"); } }