X-Git-Url: http://git.ieval.ro/?a=blobdiff_plain;f=js%2F90-themes.js;h=0bfa8bf839b2cb158da41c426e57fe9e00440538;hb=0d12c5c7ec3492867894f88979c51264374c0593;hp=56138d36f94d7000c8cba5e6599d6e1f8c7e80d1;hpb=02a539e5023724166530a97c64b7eb8bea6ace16;p=gruntmaster-page.git diff --git a/js/90-themes.js b/js/90-themes.js index 56138d3..0bfa8bf 100644 --- a/js/90-themes.js +++ b/js/90-themes.js @@ -1,7 +1,8 @@ (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') @@ -12,15 +13,16 @@ } $( 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); } })();