From: Marius Gavrilescu Date: Tue, 28 Jan 2014 12:06:41 +0000 (+0200) Subject: Fix switching of yardi logo again X-Git-Url: http://git.ieval.ro/?a=commitdiff_plain;h=dd2a82d1604a8bb280568b03417210a3eef63520;p=mindcoding-template-patches.git Fix switching of yardi logo again --- diff --git a/js/scripts.js b/js/scripts.js index 7804a29..f11336a 100644 --- a/js/scripts.js +++ b/js/scripts.js @@ -2,9 +2,7 @@ function set_style(name){ $('#stylesheet').attr("href", "/css/" + name + ".var"); localStorage.setItem("theme", name); - if(name == "slate" || name == "cyborg") { - $('#yardi').attr("src", "/img/yardi-white.png"); - } + $('#yardi').attr('src', name == "slate" || name == "cyborg" ? "/img/yardi-white.png" : "/img/yardi-blue.png"); } $( document ).ready(function() { @@ -32,5 +30,9 @@ $( document ).ready(function() { $('#theme_cosmo' ).on('click', function () { set_style("cosmo"); }); }); -if(localStorage.getItem("theme")) +if(localStorage.getItem("theme")) { set_style(localStorage.getItem("theme")); + $(document).ready(function(){ + $('#yardi').attr('src', name == "slate" || name == "cyborg" ? "/img/yardi-white.png" : "/img/yardi-blue.png"); + }) +}