X-Git-Url: http://git.ieval.ro/?a=blobdiff_plain;f=js%2F90-custom.js;h=d847fc12092dc8dcd444e7929088dc02993e59e9;hb=1c7b46db7376fdbc7e6dfd2aecd45f5a18a0b4ff;hp=3759c1b4cfdb14fb75a74426e94ad4b981eaaa91;hpb=c7a5e4e0074d51c2368d26bf31ef659286c7f7c2;p=plack-app-gruntmaster.git diff --git a/js/90-custom.js b/js/90-custom.js index 3759c1b..d847fc1 100644 --- a/js/90-custom.js +++ b/js/90-custom.js @@ -1,8 +1,17 @@ (function(){ 'use strict'; function set_style(name){ - $('#stylesheet').attr("href", "/css/" + name); + $('#stylesheet').attr("href", "/css/" + name + ".css"); localStorage.setItem("theme", name); + if(name == 'slate' || name == 'cyborg') + $('.logo').addClass('logo-dark'); + else + $('.logo').removeClass('logo-dark'); + } + + var theme = localStorage.getItem("theme"); + if(theme) { + set_style(theme); } $( document ).ready(function() { @@ -25,10 +34,13 @@ $('#theme_cerulean').on('click', function () { set_style("cerulean"); }); $('#theme_cyborg' ).on('click', function () { set_style("cyborg"); }); $('#theme_cosmo' ).on('click', function () { set_style("cosmo"); }); - }); - var theme = localStorage.getItem("theme"); - if(theme) { - set_style(theme); - } + if(!$('#sidebar').size()) { + var content = $('#content'); + content.wrapInner('
').append('