Do not change theme when new theme == current theme
authorMarius Gavrilescu <marius@ieval.ro>
Thu, 6 Aug 2015 09:47:38 +0000 (12:47 +0300)
committerMarius Gavrilescu <marius@ieval.ro>
Thu, 6 Aug 2015 09:47:38 +0000 (12:47 +0300)
js/90-themes.js

index a94d1300d9434140fc60004ea80eff1a09fb30fe..d65759c8e058646f608d8a10eb03603d63d34703 100644 (file)
@@ -3,6 +3,8 @@ function set_style(name, trans){
                document.body.classList.add('transition-color');
                setTimeout(() => document.body.classList.remove('transition-color'), 1000);
        }
+       if(q('html').className == name)
+               return;
        q('html').className = name;
        localStorage.setItem("theme", name);
 }
This page took 0.010692 seconds and 4 git commands to generate.