Make theme chooser rememeber theme
authorMarius Gavrilescu <marius@ieval.ro>
Mon, 27 Jan 2014 23:18:26 +0000 (01:18 +0200)
committerMarius Gavrilescu <marius@ieval.ro>
Mon, 27 Jan 2014 23:18:26 +0000 (01:18 +0200)
js/scripts.js

index 5ba7ecd937a64bd461105813e6f857acc70318ed..c7f0025400b482b23aa190884509bbeb0322928b 100644 (file)
@@ -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"));
This page took 0.010632 seconds and 4 git commands to generate.