forked from rDrama/rDrama
fix
parent
9fddbd8410
commit
5af1b6a0f1
|
@ -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;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue