Browse Source

DIV-726: Hide cascading dependent questions when the root question hide reveal option is enabled

pull/160/head
Benard Ebinu 8 years ago
parent
commit
b25951f8f4
2 changed files with 13 additions and 3 deletions
  1. +10
    -0
      edivorce/apps/core/static/js/functions.js
  2. +3
    -3
      edivorce/apps/core/templates/question/06_children_payor_medical.html

+ 10
- 0
edivorce/apps/core/static/js/functions.js View File

@ -105,6 +105,16 @@ var showHideTargetId = function(el, id, relatedId, revealControlGroup) {
} }
} else { } else {
$(id).hide(); $(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){ if (relatedId !== undefined){
$('#' + relatedId).show(); $('#' + relatedId).show();
} }


+ 3
- 3
edivorce/apps/core/templates/question/06_children_payor_medical.html View File

@ -205,7 +205,7 @@
</h3> </h3>
<div class="radio"> <div class="radio">
<label> <label>
{% input_field type="radio" name="does_payour_amount_match_guidelines" value="YES" data_target_id="amount_does_not_match" data_reveal_target="false" %} Yes
{% input_field type="radio" name="does_payour_amount_match_guidelines" value="YES" data_target_id="amount_does_not_match" data_reveal_target="false" data_reveal_force_hide_group=".hide-grouping" %} Yes
</label> </label>
</div> </div>
<div class="radio"> <div class="radio">
@ -215,7 +215,7 @@
</div> </div>
</div> </div>
<div class="question-well" id="amount_does_not_match" hidden>
<div class="question-well hide-grouping" id="amount_does_not_match" hidden>
<h3>Do you and the other parent agree (have consented) on the child support amount?</h3> <h3>Do you and the other parent agree (have consented) on the child support amount?</h3>
<div class="radio"> <div class="radio">
<label> <label>
@ -229,7 +229,7 @@
</div> </div>
</div> </div>
<div class="question-well" id="what_special_provisions" hidden>
<div class="question-well hide-grouping" id="what_special_provisions" hidden>
<h3>What special provisions have been made?</h3> <h3>What special provisions have been made?</h3>
{% input_field type="textarea" name="child_support_payment_special_provisions" class="response-textarea form-control" tabindex="-1" maxlength="1000" rows="3" %} {% input_field type="textarea" name="child_support_payment_special_provisions" class="response-textarea form-control" tabindex="-1" maxlength="1000" rows="3" %}
</div> </div>


Loading…
Cancel
Save