Commit d1b8bbd80d627e93fd07bafb5bb29f0eb80c5461

Authored by Ábner Silva de Oliveira
1 parent a37544a0

changed to save highcontrast option in a cookie

Showing 1 changed file with 13 additions and 2 deletions   Show diff stats
theme.js
1 1 (function($) {
  2 +
2 3 // Run code
3   -$( "#siteaction-contraste a" ).click(function() {
4   - $( "body" ).toggleClass( "contraste" );
  4 + if($.cookie("high_contrast") === 'true'){
  5 + $( "body" ).toggleClass( "contraste" );
  6 + }
  7 +
  8 + $( "#siteaction-contraste a" ).click(function() {
  9 + $( "body" ).toggleClass( "contraste" );
  10 + if($('body').hasClass('contraste')){
  11 + $.cookie('high_contrast', 'true', {path: '/'});
  12 + } else {
  13 + $.cookie('high_contrast', null, { path: '/' });
  14 + }
  15 +
5 16 });
6 17  
7 18 })(jQuery);
... ...