fix: send battery voltage as separate
This commit is contained in:
parent
5337cb2d46
commit
a33875a608
|
|
@ -270,9 +270,6 @@ function updateImage() {
|
||||||
}
|
}
|
||||||
|
|
||||||
function toggleFields() {
|
function toggleFields() {
|
||||||
const sendBatteryVoltageCheckbox = document.querySelector(
|
|
||||||
'input[name="other.sendBatteryVoltage"]'
|
|
||||||
);
|
|
||||||
const externalVoltageMeasurementCheckbox = document.querySelector(
|
const externalVoltageMeasurementCheckbox = document.querySelector(
|
||||||
'input[name="other.externalVoltageMeasurement"]'
|
'input[name="other.externalVoltageMeasurement"]'
|
||||||
);
|
);
|
||||||
|
|
@ -280,15 +277,10 @@ function toggleFields() {
|
||||||
'input[name="other.externalVoltagePin"]'
|
'input[name="other.externalVoltagePin"]'
|
||||||
);
|
);
|
||||||
|
|
||||||
externalVoltageMeasurementCheckbox.disabled =
|
|
||||||
!sendBatteryVoltageCheckbox.checked;
|
|
||||||
externalVoltagePinInput.disabled =
|
externalVoltagePinInput.disabled =
|
||||||
!externalVoltageMeasurementCheckbox.checked;
|
!externalVoltageMeasurementCheckbox.checked;
|
||||||
}
|
}
|
||||||
|
|
||||||
const sendBatteryVoltageCheckbox = document.querySelector(
|
|
||||||
'input[name="other.sendBatteryVoltage"]'
|
|
||||||
);
|
|
||||||
const externalVoltageMeasurementCheckbox = document.querySelector(
|
const externalVoltageMeasurementCheckbox = document.querySelector(
|
||||||
'input[name="other.externalVoltageMeasurement"]'
|
'input[name="other.externalVoltageMeasurement"]'
|
||||||
);
|
);
|
||||||
|
|
@ -296,16 +288,6 @@ const externalVoltagePinInput = document.querySelector(
|
||||||
'input[name="other.externalVoltagePin"]'
|
'input[name="other.externalVoltagePin"]'
|
||||||
);
|
);
|
||||||
|
|
||||||
sendBatteryVoltageCheckbox.addEventListener("change", function () {
|
|
||||||
externalVoltageMeasurementCheckbox.disabled = !this.checked;
|
|
||||||
|
|
||||||
if (!this.checked) {
|
|
||||||
externalVoltageMeasurementCheckbox.checked = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
externalVoltagePinInput.disabled = !externalVoltageMeasurementCheckbox.checked;
|
|
||||||
});
|
|
||||||
|
|
||||||
externalVoltageMeasurementCheckbox.addEventListener("change", function () {
|
externalVoltageMeasurementCheckbox.addEventListener("change", function () {
|
||||||
externalVoltagePinInput.disabled = !this.checked;
|
externalVoltagePinInput.disabled = !this.checked;
|
||||||
});
|
});
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue