Fix switching of yardi logo again
authorMarius Gavrilescu <marius@ieval.ro>
Tue, 28 Jan 2014 12:06:41 +0000 (14:06 +0200)
committerMarius Gavrilescu <marius@ieval.ro>
Tue, 28 Jan 2014 12:06:41 +0000 (14:06 +0200)
js/scripts.js

index 7804a2979564968369a5952b42aa2c577885e5d2..f11336a8de1103e34c4f2e87b1337800e4aebc6c 100644 (file)
@@ -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");
+       })
+}
This page took 0.010073 seconds and 4 git commands to generate.