cambios para corregir bug visual de los temas oscuro y blanco

This commit is contained in:
2026-06-24 10:54:33 -06:00
parent 74118a3247
commit 7f753376e3
3 changed files with 37 additions and 6 deletions

View File

@@ -55,7 +55,7 @@ const Config = (() => {
// -------------------------------------------------------------------------
// Theme switcher
// -------------------------------------------------------------------------
function setTheme(theme) {
/*function setTheme(theme) {
document.documentElement.setAttribute('data-theme', theme);
try { localStorage.setItem('pos_theme', theme); } catch(e) {}
@@ -70,7 +70,22 @@ const Config = (() => {
var opts = document.querySelectorAll('.theme-option');
if (opts[idx]) opts[idx].classList.add('is-selected');
}
window.setTheme = setTheme;
window.setTheme = setTheme;*/
function setTheme(theme) {
if (window.posSetTheme) window.posSetTheme(theme);
document.querySelectorAll('.theme-btn').forEach(function(btn) {
btn.classList.toggle('is-active', btn.dataset.themeTarget === theme);
});
document.querySelectorAll('.theme-option').forEach(function(opt) {
opt.classList.remove('is-selected');
});
var idx = theme === 'industrial' ? 0 : 1;
var opts = document.querySelectorAll('.theme-option');
if (opts[idx]) opts[idx].classList.add('is-selected');
}
function selectThemeOption(theme) {
setTheme(theme);