From 09d6aacc0f688688822fe2d182c6ab00efe2ef14 Mon Sep 17 00:00:00 2001 From: Ad Schellevis Date: Tue, 4 Aug 2015 13:22:16 +0000 Subject: [PATCH] (legacy) backport show all help button behaviour to legacy code --- src/www/head.inc | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/src/www/head.inc b/src/www/head.inc index aa02e9148..068eaf7eb 100644 --- a/src/www/head.inc +++ b/src/www/head.inc @@ -100,9 +100,23 @@ $pagetitle = gentitle( $pgtitle ); // link showhelp class behavior $("a[class='showhelp']").click(function (event) { - $("*[for='" + $(this).attr('id') + "']").toggleClass("hidden show"); - event.preventDefault(); - }); + $("*[for='" + $(this).attr('id') + "']").toggleClass("hidden show"); + event.preventDefault(); + }); + + // handle all help messages show/hide + $('[id*="show_all_help"]').click(function(event) { + $('[id*="show_all_help"]').toggleClass("fa-toggle-on fa-toggle-off"); + $('[id*="show_all_help"]').toggleClass("text-success text-danger"); + if ($('[id*="show_all_help"]').hasClass("fa-toggle-on")) { + $('[for*="help_for"]').addClass("show"); + $('[for*="help_for"]').removeClass("hidden"); + } else { + $('[for*="help_for"]').addClass("hidden"); + $('[for*="help_for"]').removeClass("show"); + } + event.preventDefault(); + }); }); //]]>