diff --git a/ereuse_devicehub/static/js/main_inventory.js b/ereuse_devicehub/static/js/main_inventory.js index 4ba8ced2..36ba13fd 100644 --- a/ereuse_devicehub/static/js/main_inventory.js +++ b/ereuse_devicehub/static/js/main_inventory.js @@ -200,8 +200,9 @@ async function processSelectedDevices() { */ manage(event, lotID, deviceListID) { event.preventDefault(); - const {indeterminate} = event.srcElement; - const checked = !event.srcElement.checked; + const srcElement = event.srcElement.parentElement.children[0] + const indeterminate = srcElement.indeterminate; + const checked = !srcElement.checked; const found = this.list.filter(list => list.lotID == lotID)[0]; const foundIndex = found != undefined ? this.list.findLastIndex(x => x.lotID == found.lotID) : -1; @@ -339,8 +340,8 @@ async function processSelectedDevices() { } else { doc.children[0].indeterminate = true; } - - doc.children[0].addEventListener("mouseup", (ev) => actions.manage(ev, lotID, selectedDevicesIDs)); + doc.children[0].addEventListener('mouseup', (ev) => actions.manage(ev, lotID, selectedDevicesIDs)); + doc.children[1].addEventListener('mouseup', (ev) => actions.manage(ev, lotID, selectedDevicesIDs)); elementTarget.append(doc); } diff --git a/ereuse_devicehub/templates/inventory/device_list.html b/ereuse_devicehub/templates/inventory/device_list.html index 10305ac4..8d962d90 100644 --- a/ereuse_devicehub/templates/inventory/device_list.html +++ b/ereuse_devicehub/templates/inventory/device_list.html @@ -32,10 +32,10 @@