]> iEval git - plack-app-gruntmaster.git/blobdiff - js/90-themes.js
Change message on us.en
[plack-app-gruntmaster.git] / js / 90-themes.js
index 74506c83b98ba7e951d92a5749955c4f1a3d1ec5..7221ddeac3eb40f7ea1e22255aa5ead6ed84d872 100644 (file)
@@ -1,20 +1,22 @@
 (function(){
        'use strict';
        function set_style(name){
-               $('#stylesheet').attr("href", "/css/" + name + ".css");
+               $('link[rel~="stylesheet"]').prop('disabled', true);
+               $('link[title="' + name + '"]').prop('disabled', false);
                localStorage.setItem("theme", name);
        }
 
        $( document ).ready(function() {
-               $('#theme-selector').removeClass('hidden');
+               $('#theme-selector').detach().prependTo($('#sidebar'));
                $('#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"); });
+               $('#theme_readable').on('click', function () { set_style("readable"); });
        });
 
        var theme = localStorage.getItem("theme");
        if(theme) {
+               if(theme == "cerulean" || theme == "cosmo")
+                       theme = "readable";
                set_style(theme);
        }
 })();
This page took 0.019052 seconds and 4 git commands to generate.