Merge pull request #1651 from notriddle/notriddle/theme-switcher-js
Only switch to themes on buttons that have the `theme` class
This commit is contained in:
commit
601ebc5499
|
@ -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);
|
||||
});
|
||||
|
||||
|
|
Loading…
Reference in New Issue