Only switch to themes on buttons that have the `theme` class

Fixes #1649
This commit is contained in:
Michael Howell 2021-09-14 10:05:35 -07:00
parent 93008cf20b
commit 4251d7a838
1 changed files with 8 additions and 1 deletions

View File

@ -371,7 +371,14 @@ function playground_text(playground) {
});
themePopup.addEventListener('click', function (e) {
var theme = e.target.id || e.target.parentElement.id;
var theme;
if (e.target.className === "theme") {
theme = e.target.id;
} else if (e.target.parentElement.className === "theme") {
theme = e.target.parentElement.id;
} else {
return;
}
set_theme(theme);
});