This commit is contained in:
kek7198 2021-12-19 13:52:43 -06:00
parent 72a77cc919
commit 6b75d2b34a
2 changed files with 18 additions and 17 deletions

View file

@ -146,18 +146,3 @@ function expandDesktopImage(image) {
document.getElementById("desktop-expanded-image-link").href = image;
document.getElementById("desktop-expanded-image-wrap-link").href=image;
};
var previousTheme = ['theme-iron','dark'];
function changeTheme(theme) {
const body = document.body;
// if previous selection has a value, remove them from body tag
if (previousTheme.length) {
previousTheme.map(v => body.classList.toggle(v));
}
// toggle classes in body tag
theme.map(v => body.classList.toggle(v));
// Set global previous selection to current selection
previousTheme = theme;
}

View file

@ -348,8 +348,24 @@
{% if v %}
<script>function formkey() {return '{{v.formkey}}';}</script>
<script>
var previousTheme = ['theme-iron','dark'];
//var previousTheme = {{ u.theme }}.split(' ');
function changeTheme(theme) {
const body = document.body;
// if previous selection has a value, remove them from body tag
if (previousTheme.length) {
previousTheme.map(v => body.classList.toggle(v));
}
// toggle classes in body tag
theme.map(v => body.classList.toggle(v));
// Set global previous selection to current selection
previousTheme = theme;
}
</script>
{% endif %}
<script src="/assets/CHRISTMAS/js/default.js?v=203"></script>
<script src="/assets/CHRISTMAS/js/default.js?v=204"></script>
</body>
</html>