feat: new navbar

This commit is contained in:
SQ2CPA
2024-03-17 17:45:59 +01:00
parent d9629d0929
commit 9f617c406e
2 changed files with 50 additions and 124 deletions
+12 -4
View File
@@ -167,6 +167,7 @@ function loadSettings(settings) {
settings.other.sendBatteryVoltage;
document.getElementById("other.externalVoltageMeasurement").checked =
settings.other.externalVoltageMeasurement;
document.getElementById("other.externalVoltagePin").value =
settings.other.externalVoltagePin;
// document.getElementById("beacon.igateSendsLoRaBeacon").value =
@@ -212,6 +213,7 @@ function loadSettings(settings) {
updateImage();
refreshSpeedStandard();
toggleFields();
}
const bmeCheckbox = document.querySelector("input[name='bme.active']");
@@ -272,8 +274,16 @@ const externalVoltagePinInput = document.querySelector(
sendBatteryVoltageCheckbox.addEventListener("change", function () {
externalVoltageMeasurementCheckbox.disabled = !this.checked;
externalVoltagePinInput.disabled =
!externalVoltageMeasurementCheckbox.checked;
if (!this.checked) {
externalVoltageMeasurementCheckbox.checked = false;
}
externalVoltagePinInput.disabled = !externalVoltageMeasurementCheckbox.checked;
});
externalVoltageMeasurementCheckbox.addEventListener("change", function () {
externalVoltagePinInput.disabled = !this.checked;
});
document.querySelector(".new button").addEventListener("click", function () {
@@ -383,8 +393,6 @@ document.getElementById("action.speed").addEventListener("change", function () {
}
});
toggleFields();
const form = document.querySelector("form");
const saveModal = new bootstrap.Modal(document.getElementById("saveModal"), {