diff --git a/scripts/system/create/entityProperties/html/js/entityProperties.js b/scripts/system/create/entityProperties/html/js/entityProperties.js index 5c6806653d..0136d99cc4 100644 --- a/scripts/system/create/entityProperties/html/js/entityProperties.js +++ b/scripts/system/create/entityProperties/html/js/entityProperties.js @@ -3695,20 +3695,20 @@ function requestZoneList() { })); } -function addZoneToZonesSelection(propertyId) { +function addZoneToZonesSelection(propertyId, id) { let hiddenField = document.getElementById(propertyId); if (JSON.stringify(hiddenField.value) === '"undefined"') { hiddenField.value = "[]"; } let selectedZones = JSON.parse(hiddenField.value); - let zoneToAdd = document.getElementById("zones-select-" + propertyId).value; - if (!selectedZones.includes(zoneToAdd)) { - selectedZones.push(zoneToAdd); + if (!selectedZones.includes(id)) { + selectedZones.push(id); } hiddenField.value = JSON.stringify(selectedZones); displaySelectedZones(propertyId, true); let propertyName = propertyId.replace("property-", ""); updateProperty(propertyName, selectedZones, false); + document.getElementById("zones-select-selector-list-panel-" + propertyId).style.display = "none"; } function removeZoneFromZonesSelection(propertyId, zoneId) { @@ -3798,7 +3798,12 @@ function createZonesSelection(property, elProperty) { function setZonesSelectionData(element, isEditable) { let zoneSelectorContainer = document.getElementById("zones-selector-" + element.id); - let zoneSelector = "
"; zoneSelector += ""; zoneSelectorContainer.innerHTML = zoneSelector; displaySelectedZones(element.id, isEditable); } function updateAllZoneSelect() { - let allZoneSelects = document.querySelectorAll(".zoneSelect"); - let i, j, name, propId; + let allZoneSelects = document.querySelectorAll(".zoneSelectList"); + let i, j, name, propId, btnList; for (i = 0; i < allZoneSelects.length; i++) { - allZoneSelects[i].options.length = 0; + btnList = ""; for (j = 0; j < zonesList.length; j++) { if (zonesList[j].name === "") { name = zonesList[j].id; } else { name = zonesList[j].name; } - allZoneSelects[i].options[j] = new Option(name, zonesList[j].id, false , false); + btnList += "