On back button restore venting options

This commit is contained in:
gaazzopa 2020-12-09 21:36:39 +01:00
parent d9801553a7
commit 5760b49c74
2 changed files with 8 additions and 14 deletions

View file

@ -128,9 +128,6 @@ function require_natural_ventilation(option) {
$("#window_hinged").prop('required', option);
$("#always").prop('required', option);
$("#interval").prop('required', option);
$("#window_sliding").prop('checked', option);
require_window_width(false);
}
function require_window_width(option) {
@ -483,7 +480,9 @@ $(document).ready(function () {
require_fields($("input[name='volume_type']:checked"));
require_fields($("input[name='mechanical_ventilation_type']:checked"));
require_fields($("input[name='window_type']:checked"));
require_fields($("input[name='windows_open']:checked"));
require_fields($("input[name='hepa_option']:checked"));
require_fields($("input[name='event_type']:checked"));
// Setup the maximum number of people at page load (to handle back/forward),
// and update it when total people is changed.
@ -508,11 +507,6 @@ $(document).ready(function () {
$(".start_time[data-lunch-for]").each(function() {validateLunchBreak($(this).data('time-group'))});
$("[data-lunch-for]").change(function() {validateLunchBreak($(this).data('time-group'))});
$("[data-lunch-break]").change(function() {validateLunchBreak($(this).data('lunch-break'))});
var radioValue = $("input[name='event_type']:checked");
if (radioValue.val()) {
require_fields(radioValue.get(0));
}
});
/* -------Debugging------- */

View file

@ -87,12 +87,12 @@
Width of window: <input type="number" step="any" id="window_width" class="non_zero disabled" name="window_width" placeholder="meters" min="0" data-has-radio="#window_hinged"><br>
Opening distance: <input type="number" step="any" id="opening_distance" class="non_zero" name="opening_distance" placeholder="meters" min="0"><br>
Windows open:</span><br>
<span class="tabbed"><input type="radio" id="always" name="windows_open" value="always" onclick="require_fields(this)" checked="checked"></span>
<label for="always">Permanently</label><br>
<span class="tabbed"><input type="radio" id="interval" name="windows_open" value="interval" onclick="require_fields(this)"></span>
<label for="interval">Periodically:</label>&nbsp;&nbsp;
<input type="number" step="any" id="windows_duration" class="disabled" name="windows_duration" placeholder="Duration (min)" min="1" data-has-radio="#interval"> /
<input type="number" step="any" id="windows_frequency" class="disabled" name="windows_frequency" placeholder="Frequency (min)" min="1" data-has-radio="#interval">
<span class="tabbed"><input type="radio" id="always" name="windows_open" value="always" onclick="require_fields(this)" checked="checked"></span>
<label for="always">Permanently</label><br>
<span class="tabbed"><input type="radio" id="interval" name="windows_open" value="interval" onclick="require_fields(this)"></span>
<label for="interval">Periodically:</label>&nbsp;&nbsp;
<input type="number" step="any" id="windows_duration" class="disabled" name="windows_duration" placeholder="Duration (min)" min="1" data-has-radio="#interval"> /
<input type="number" step="any" id="windows_frequency" class="disabled" name="windows_frequency" placeholder="Frequency (min)" min="1" data-has-radio="#interval">
<br>
</div>