From d2d089618b82fbbdc03fd3ede37c0592b2cea2f7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Patrik=20Elfstr=C3=B6m?= Date: Sun, 10 Nov 2024 01:07:57 +0100 Subject: [PATCH] Select log levels by default visually Fixes bug where the first time visiting Execution Log view all log levels are deselected but log items with all levels are still displayed. --- src/webui/www/private/views/log.html | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/src/webui/www/private/views/log.html b/src/webui/www/private/views/log.html index da5471502..8ce6fc94c 100644 --- a/src/webui/www/private/views/log.html +++ b/src/webui/www/private/views/log.html @@ -188,12 +188,8 @@ let selectedLogLevels = JSON.parse(LocalPreferences.get("qbt_selected_log_levels")) || ["1", "2", "4", "8"]; const init = () => { - $("logLevelSelect").getElements("option").each((x) => { - if (selectedLogLevels.indexOf(x.value.toString()) !== -1) - x.selected = true; - else - x.selected = false; - }); + for (const option of $("logLevelSelect").options) + option.setAttribute("selected", selectedLogLevels.includes(option.value)); selectBox = new vanillaSelectBox("#logLevelSelect", { maxHeight: 200,