diff --git a/theme.js b/theme.js index f75e181..365a308 100644 --- a/theme.js +++ b/theme.js @@ -1,7 +1,18 @@ (function($) { + // Run code -$( "#siteaction-contraste a" ).click(function() { - $( "body" ).toggleClass( "contraste" ); + if($.cookie("high_contrast") === 'true'){ + $( "body" ).toggleClass( "contraste" ); + } + + $( "#siteaction-contraste a" ).click(function() { + $( "body" ).toggleClass( "contraste" ); + if($('body').hasClass('contraste')){ + $.cookie('high_contrast', 'true', {path: '/'}); + } else { + $.cookie('high_contrast', null, { path: '/' }); + } + }); })(jQuery); -- libgit2 0.21.2