1
0
mirror of https://github.com/KubaPro010/fm-dx-webserver.git synced 2026-02-26 22:13:53 +01:00

bugfixes, UI improvements, logging improvements

This commit is contained in:
NoobishSVK
2024-09-15 14:47:32 +02:00
parent 546997f351
commit e29e3a3f04
11 changed files with 120 additions and 49 deletions

View File

@@ -155,6 +155,13 @@ $(document).ready(() => {
$('.version-string').text(currentVersion);
setBg();
updateIconState();
// Update icons when the checkbox state changes
$('input[type="checkbox"]').change(function() {
updateIconState();
});
});
function getQueryParameter(name) {
@@ -162,6 +169,17 @@ function getQueryParameter(name) {
return urlParams.get(name);
}
function updateIconState() {
$('input[type="checkbox"]').each(function() {
var icon = $(this).siblings('label').find('i');
if ($(this).is(':checked')) {
icon.removeClass('fa-toggle-off').addClass('fa-toggle-on');
} else {
icon.removeClass('fa-toggle-on').addClass('fa-toggle-off');
}
});
}
function setTheme(themeName) {
const themeColors = themes[themeName];
if (themeColors) {
@@ -191,4 +209,5 @@ function setBg() {
} else {
$('body').css('background', 'var(--color-main)');
}
}
}