From 60b6f7df89c705cc91dc0c20d510be9a91ab4e1b Mon Sep 17 00:00:00 2001 From: Elian Doran Date: Sun, 27 Oct 2024 12:54:06 +0200 Subject: [PATCH] client: Allow switching theme --- .../type_widgets/options/appearance/highlighting.js | 8 ++++++-- src/routes/api/options.ts | 1 + src/services/options_init.ts | 3 ++- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/src/public/app/widgets/type_widgets/options/appearance/highlighting.js b/src/public/app/widgets/type_widgets/options/appearance/highlighting.js index 1b99430c1..9e6396004 100644 --- a/src/public/app/widgets/type_widgets/options/appearance/highlighting.js +++ b/src/public/app/widgets/type_widgets/options/appearance/highlighting.js @@ -18,6 +18,10 @@ export default class HighlightingOptions extends OptionsWidget { doRender() { this.$widget = $(TPL); this.$themeSelect = this.$widget.find(".theme-select"); + this.$themeSelect.on("change", async () => { + const newTheme = this.$themeSelect.val(); + await server.put(`options/highlightingTheme/${newTheme}`); + }); } async optionsLoaded(options) { @@ -27,8 +31,8 @@ export default class HighlightingOptions extends OptionsWidget { for (const theme of themes) { this.$themeSelect.append($("