Remember user preferrence in localStorage

This commit is contained in:
Misode
2019-12-20 19:04:32 +01:00
parent 828af07a8a
commit 9d038dc3bc
2 changed files with 6 additions and 1 deletions
+5
View File
@@ -32,8 +32,13 @@ function changeVersion(version) {
});
}
changeTheme(localStorage.getItem('theme'))
function changeTheme(theme) {
if (theme === null) {
theme = 'light';
}
$('body').attr('data-style', theme);
localStorage.setItem('theme', theme);
}
function updateView() {