From: Marius Gavrilescu Date: Mon, 27 Jan 2014 23:18:26 +0000 (+0200) Subject: Make theme chooser rememeber theme X-Git-Url: http://git.ieval.ro/?p=mindcoding-template-patches.git;a=commitdiff_plain;h=b78f93c9ca9f61f24ea5188afee0e61283b94600 Make theme chooser rememeber theme --- diff --git a/js/scripts.js b/js/scripts.js index 5ba7ecd..c7f0025 100644 --- a/js/scripts.js +++ b/js/scripts.js @@ -1,5 +1,6 @@ function set_style(name){ $('#stylesheet').attr("href", "/css/" + name + ".var"); + localStorage.setItem("theme", name); } $( document ).ready(function() { @@ -25,3 +26,6 @@ $( document ).ready(function() { $('#theme_cerulean').on('click', function () { set_style("cerulean"); }); $('#theme_cyborg' ).on('click', function () { set_style("cyborg"); }); }); + +if(localStorage.getItem("theme")) + set_style(localStorage.getItem("theme"));