forked from rDrama/rDrama
1
0
Fork 0
master
kek7198 2021-12-21 20:57:15 -06:00
parent 9fddbd8410
commit 5af1b6a0f1
1 changed files with 5 additions and 5 deletions

View File

@ -350,13 +350,13 @@
<script> <script>
var previousTheme = '{{ v.theme2 }}'.split(' '); var previousTheme = '{{ v.theme2 }}'.split(' ');
function changeTheme(theme) { function changeTheme(theme) {
const body = document.body; const root = document.documentElement
// if previous selection has a value, remove them from body tag // if previous selection has a value, remove them from root html tag
if (previousTheme.length) { if (previousTheme.length) {
previousTheme.map(v => body.classList.toggle(v)); previousTheme.map(v => root.classList.toggle(v));
} }
// toggle classes in body tag // toggle classes in root html tag
theme.map(v => body.classList.toggle(v)); theme.map(v => root.classList.toggle(v));
// Set global previous selection to current selection // Set global previous selection to current selection
previousTheme = theme; previousTheme = theme;
} }