From 5220cddbdf86ecda5af00202acf9c4af2b9b081f Mon Sep 17 00:00:00 2001 From: Ábner Silva de Oliveira Date: Wed, 12 Feb 2014 18:32:53 -0300 Subject: [PATCH] fixed theme.js to save highcontrast option to cookie --- theme.js | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) 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