Commit ec6c84b1702ce391e89a89a5ae433b2d22bffe67
1 parent
015ee632
Exists in
high_contrast
Adds the javascript that handle high-contrast.
Signed-off-by: Dylan Guedes <djmgguedes@gmail.com>
Showing
1 changed file
with
18 additions
and
0 deletions
Show diff stats
src/noosfero-spb/noosfero-spb-theme/theme.js
@@ -310,3 +310,21 @@ SPBNoosferoTheme.NoosferoFoldersContent = (function($) { | @@ -310,3 +310,21 @@ SPBNoosferoTheme.NoosferoFoldersContent = (function($) { | ||
310 | SPBNoosferoTheme.NoosferoFoldersContent.init(); | 310 | SPBNoosferoTheme.NoosferoFoldersContent.init(); |
311 | }); | 311 | }); |
312 | }) (jQuery); | 312 | }) (jQuery); |
313 | + | ||
314 | +jQuery(document).ready(function($) { | ||
315 | + var actual_body = $("body"); | ||
316 | + | ||
317 | + if ($.cookie("high_contrast") === "true") { | ||
318 | + actual_body.toggleClass("active_contrast"); | ||
319 | + } | ||
320 | + | ||
321 | + $("#siteaction-contraste a").click(function() { | ||
322 | + actual_body.toggleClass("active_contrast"); | ||
323 | + | ||
324 | + if (actual_body.hasClass("active_contrast")) { | ||
325 | + $.cookie("high_contrast", "true", { path: "/" }); | ||
326 | + } else { | ||
327 | + $.cookie("high_contrast", null, { path: "/" }); | ||
328 | + } | ||
329 | + }); | ||
330 | +}); |