Persist selected theme in dropdown

This commit is contained in:
billz
2017-10-09 14:04:59 +00:00
parent f6c983d8ff
commit 8a501c075f
3 changed files with 27 additions and 10 deletions

View File

@@ -6,7 +6,7 @@ $(function() {
});
function set_theme(theme) {
$('link[title="main"]').attr('href', theme);
$('link[title="main"]').attr('href', 'dist/css/' + theme);
// persist selected theme in cookie
setCookie('theme',theme,90);
@@ -20,9 +20,9 @@ function setCookie(cname, cvalue, exdays) {
}
var themes = {
"default": "dist/css/custom.css",
"hackernews" : "dist/css/hackernews.css",
"terminal" : "dist/css/terminal.css",
"default": "custom.css",
"hackernews" : "hackernews.css",
"terminal" : "terminal.css",
}
//Loads the correct sidebar on window load,