mirror of
https://github.com/msitarzewski/agency-agents.git
synced 2026-10-10 12:45:05 +00:00
Merge #1042: Make UX Architect theme toggles work when clicking nested labels
This commit is contained in:
@@ -246,9 +246,13 @@ class ThemeManager {
|
||||
const toggle = document.querySelector('.theme-toggle');
|
||||
if (toggle) {
|
||||
toggle.addEventListener('click', (e) => {
|
||||
if (e.target.matches('.theme-toggle-option')) {
|
||||
const newTheme = e.target.dataset.theme;
|
||||
this.applyTheme(newTheme);
|
||||
const option = e.target instanceof Element
|
||||
? e.target.closest('.theme-toggle-option') : null;
|
||||
if (option && toggle.contains(option)) {
|
||||
const newTheme = option.dataset.theme;
|
||||
if (['system', 'light', 'dark'].includes(newTheme)) {
|
||||
this.applyTheme(newTheme);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user