Module: appdb
Branch: master
Commit: 622dd64c06406c30f40148b33227cc4da1aa78db
URL: http://source.winehq.org/git/appdb.git/?a=commit;h=622dd64c06406c30f40148b3…
Author: Rosanne DiMesio <dimesio(a)earthlink.net>
Date: Mon Nov 6 11:11:44 2017 -0600
Show/hide div based on radio button clicks
Adds javascript function that will be used to
show or hide the test report form textareas
that have radio button yes/no questions (currently the
What does not work and Workarounds fields).
Signed-off-by: Rosanne DiMesio <dimesio(a)earthlink.net>
Signed-off-by: Jeremy Newman <jnewman(a)codeweavers.com>
---
js/utils.js | 14 ++++++++++++--
1 file changed, 12 insertions(+), 2 deletions(-)
diff --git a/js/utils.js b/js/utils.js
index 0fdcb92..b4adc9a 100644
--- a/js/utils.js
+++ b/js/utils.js
@@ -222,9 +222,19 @@ $(document).ready(function()
$(this).collapse('show');
}
});
-
- // HTML editor (redactor loader)
+
+ /* Show/hide div based on radio button clicks. */
+ $('input[type=radio][data-toggle=radioshow]').click(function(){
+ if($(this).data("showdiv") == true) {
+ $($(this).data("target")).show();
+ }
+ else if($(this).data("showdiv") == false) {
+ $($(this).data("target")).hide();
+ }
+ });
+ $('[data-toggle="radioshow"]:checked').trigger('click');
+ // HTML editor (redactor loader)
});