X-Git-Url: http://git.ieval.ro/?a=blobdiff_plain;f=js%2Fscripts.js;h=6e0827d502cbfd8f76c77e025bca4c824c0ed27c;hb=0561ec254c91314618935a289a5a9df77d9e3277;hp=c7f0025400b482b23aa190884509bbeb0322928b;hpb=b78f93c9ca9f61f24ea5188afee0e61283b94600;p=mindcoding-template-patches.git diff --git a/js/scripts.js b/js/scripts.js index c7f0025..6e0827d 100644 --- a/js/scripts.js +++ b/js/scripts.js @@ -1,6 +1,8 @@ function set_style(name){ $('#stylesheet').attr("href", "/css/" + name + ".var"); localStorage.setItem("theme", name); + + $('#yardi').attr('src', name == "slate" || name == "cyborg" ? "/img/yardi-white.png" : "/img/yardi-blue.png"); } $( document ).ready(function() { @@ -25,7 +27,13 @@ $( document ).ready(function() { $('#theme_slate' ).on('click', function () { set_style("slate"); }); $('#theme_cerulean').on('click', function () { set_style("cerulean"); }); $('#theme_cyborg' ).on('click', function () { set_style("cyborg"); }); + $('#theme_cosmo' ).on('click', function () { set_style("cosmo"); }); }); -if(localStorage.getItem("theme")) - set_style(localStorage.getItem("theme")); +var theme = localStorage.getItem("theme"); +if(theme) { + set_style(theme); + $(document).ready(function(){ + $('#yardi').attr('src', theme == "slate" || theme == "cyborg" ? "/img/yardi-white.png" : "/img/yardi-blue.png"); + }) +}