Commit 5220cddbdf86ecda5af00202acf9c4af2b9b081f
1 parent
f57f9159
Exists in
master
and in
2 other branches
fixed theme.js to save highcontrast option to 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); | ... | ... |