From 09b7dbe4df93709379638a639b846a84ff6c6b96 Mon Sep 17 00:00:00 2001 From: Gaby Azzopardi Date: Fri, 12 Mar 2021 14:33:35 +0100 Subject: [PATCH] Unrequire ventilation options not selected --- cara/apps/calculator/static/js/form.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/cara/apps/calculator/static/js/form.js b/cara/apps/calculator/static/js/form.js index 92ab638b..43717598 100644 --- a/cara/apps/calculator/static/js/form.js +++ b/cara/apps/calculator/static/js/form.js @@ -486,12 +486,6 @@ $(document).ready(function () { // as a result of a forward/back browser action. If that is the case, update // the visibility of some of our inputs. - // When the ventilation_type changes we want to make its respective - // children show/hide. - $("input[type=radio][name=ventilation_type]").change(on_ventilation_type_change); - // Call the function now to handle forward/back button presses in the browser. - on_ventilation_type_change(); - // Chrome fix - on back button infected break DIV not shown if (document.getElementById("infected_dont_have_breaks_with_exposed").checked) { $("#DIVinfected_breaks").show(); @@ -502,6 +496,12 @@ $(document).ready(function () { //Check all radio buttons previously selected $("input[type=radio]:checked").each(function() {require_fields(this)}); + // When the ventilation_type changes we want to make its respective + // children show/hide. + $("input[type=radio][name=ventilation_type]").change(on_ventilation_type_change); + // Call the function now to handle forward/back button presses in the browser. + on_ventilation_type_change(); + // Setup the maximum number of people at page load (to handle back/forward), // and update it when total people is changed. setMaxInfectedPeople();