X-Git-Url: http://git.ieval.ro/?a=blobdiff_plain;f=js%2F90-themes.js;h=0bfa8bf839b2cb158da41c426e57fe9e00440538;hb=2f64890f1e92658a274f47d6bd7d2baf587bf179;hp=5ec968a4552821ba55119ec759b007f5057d0826;hpb=2d5a49fc7d61e2a7353ece540c3f12f2f08a0ba0;p=gruntmaster-page.git diff --git a/js/90-themes.js b/js/90-themes.js index 5ec968a..0bfa8bf 100644 --- a/js/90-themes.js +++ b/js/90-themes.js @@ -1,19 +1,28 @@ (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() { + if(name == 'slate' || name == 'cyborg') + $('.logo').removeClass('logo-light'); + else + $('.logo').addClass('logo-light'); + }); } $( 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); } })();