diff --git a/dist/js/sb-admin-2.js b/dist/js/sb-admin-2.js index 3bbc30da..ce024e24 100755 --- a/dist/js/sb-admin-2.js +++ b/dist/js/sb-admin-2.js @@ -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, diff --git a/includes/themes.php b/includes/themes.php index 0b502341..44af3511 100644 --- a/includes/themes.php +++ b/includes/themes.php @@ -5,6 +5,22 @@ */ function DisplayThemeConfig(){ + $cselected = ''; + $hselected = ''; + $tselected = ''; + + switch( $_COOKIE['theme'] ) { + case "custom.css": + $cselected = "selected"; + break; + case "hackernews.css": + $hselected = "selected"; + break; + case "terminal.css": + $tselected = "selected"; + break; + } + ?>