Browse Source

Uncheck minor devices when the major device changes

master
Mobius K 3 years ago
parent
commit
d697f56da7
  1. 3
      src/scripts/bluetooth.js

3
src/scripts/bluetooth.js

@ -33,8 +33,9 @@ function updateBluetoothMinorDeviceFields() {
const majorDeviceRadio = document.querySelector(`input[type='radio'][name='majorDevice'][value='${majorDevice}']`);
const majorDeviceId = majorDeviceRadio.id.replace("majorDevice", "");
// Hide all minor device fields that don't match our major device id
// Hide all minor device fields that don't match our major device id and uncheck them
minorDeviceGroups.forEach((element) => {
element.querySelectorAll("input").forEach((minorDevice) => minorDevice.checked = false);
element.classList.add("hidden");
if (element.classList.contains(majorDeviceId)) {
element.classList.remove("hidden");

Loading…
Cancel
Save