From b25951f8f4a6968db2f2e8d7a671bd97c3c666e0 Mon Sep 17 00:00:00 2001 From: Benard Ebinu Date: Mon, 15 Jan 2018 16:24:42 -0800 Subject: [PATCH] DIV-726: Hide cascading dependent questions when the root question hide reveal option is enabled --- edivorce/apps/core/static/js/functions.js | 10 ++++++++++ .../templates/question/06_children_payor_medical.html | 6 +++--- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/edivorce/apps/core/static/js/functions.js b/edivorce/apps/core/static/js/functions.js index 1eb65273..921bcc29 100644 --- a/edivorce/apps/core/static/js/functions.js +++ b/edivorce/apps/core/static/js/functions.js @@ -105,6 +105,16 @@ var showHideTargetId = function(el, id, relatedId, revealControlGroup) { } } else { $(id).hide(); + + // This is the bit of a hack/workaround but so far this is the only case + // where we have a none nested related questions. When the first + // question is hidden, all elements in the force_hide group should also + // be hidden. + if (el.data("reveal_force_hide_group")) { + $(el.data("reveal_force_hide_group")).hide(); + $(el.data("reveal_force_hide_group")).find(':radio').prop('checked', false); + } + if (relatedId !== undefined){ $('#' + relatedId).show(); } diff --git a/edivorce/apps/core/templates/question/06_children_payor_medical.html b/edivorce/apps/core/templates/question/06_children_payor_medical.html index e7d2cf56..3bc0379d 100644 --- a/edivorce/apps/core/templates/question/06_children_payor_medical.html +++ b/edivorce/apps/core/templates/question/06_children_payor_medical.html @@ -205,7 +205,7 @@
@@ -215,7 +215,7 @@
-