X-Git-Url: http://git.ieval.ro/?a=blobdiff_plain;f=js%2F90-themes.js;h=7221ddeac3eb40f7ea1e22255aa5ead6ed84d872;hb=19909af7912808638f003dbd9e8fc5904cf1ae54;hp=5ec968a4552821ba55119ec759b007f5057d0826;hpb=2d5a49fc7d61e2a7353ece540c3f12f2f08a0ba0;p=plack-app-gruntmaster.git diff --git a/js/90-themes.js b/js/90-themes.js index 5ec968a..7221dde 100644 --- a/js/90-themes.js +++ b/js/90-themes.js @@ -1,19 +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').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); } })();