Merge branch '546-additional-fields' into 'master'

Reset the motolite battery flag when loading page and loading customer vehicle. #546

Closes #546

See merge request jankstudio/resq!642
This commit is contained in:
Kendrick Chan 2021-03-19 10:11:47 +00:00
commit 471ca80d12

View file

@ -269,7 +269,7 @@
<div class="col-g-3"> <div class="col-g-3">
<span class="m-switch m-switch--icon block-switch"> <span class="m-switch m-switch--icon block-switch">
<label> <label>
<input type="checkbox" name="flag_motolite_battery" id="flag-motolite-battery" value="1" disabled> <input type="checkbox" name="flag_motolite_battery" id="flag-motolite-battery" value="1" {{ obj.getCustomerVehicle.getCurrentBattery|default(false) ? obj.getCustomerVehicle.hasMotoliteBattery ? ' checked' }} disabled>
<label class="switch-label">This vehicle is using a Motolite battery</label> <label class="switch-label">This vehicle is using a Motolite battery</label>
<span></span> <span></span>
</label> </label>
@ -1381,6 +1381,7 @@ $(function() {
$("#flag-motolite-battery").prop("checked", true); $("#flag-motolite-battery").prop("checked", true);
} else { } else {
$("#current-battery, #warranty-code, #warranty-expiration").val("No current battery").css('color', '#f4516c'); $("#current-battery, #warranty-code, #warranty-expiration").val("No current battery").css('color', '#f4516c');
$("#flag-motolite-battery").prop("checked", false);
} }
}) })
}).focus(); }).focus();