better support for javascript disabled browsers

This commit is contained in:
Worble 2019-05-06 23:08:24 +01:00
parent df5fc9890b
commit d2a2d9459a
3 changed files with 13 additions and 3 deletions

View file

@ -16,6 +16,7 @@ function changeTheme(themeName) {
document.querySelectorAll('link.stylesheet').forEach(element => {
if (element.id === themeName) {
element.disabled = false;
element.media = '';
}
else {
alternates.push(element);
@ -24,6 +25,7 @@ function changeTheme(themeName) {
alternates.forEach(element => {
element.disabled = true;
element.media = 'none';
});
saveTheme(themeName);