Skip to content

Commit

Permalink
Only switch to themes on buttons that have the theme class
Browse files Browse the repository at this point in the history
Fixes #1649
  • Loading branch information
notriddle committed Sep 14, 2021
1 parent 93008cf commit 4251d7a
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/theme/book.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
});

Expand Down

0 comments on commit 4251d7a

Please sign in to comment.