mirror of
https://github.com/JulianGro/overte.git
synced 2025-04-29 20:42:56 +02:00
To really avoid a regression
This commit is contained in:
parent
cc6fc40b0e
commit
8c1d80d495
1 changed files with 21 additions and 25 deletions
|
@ -67,16 +67,11 @@ const GROUPS = [
|
||||||
replaceID: "placeholder-property-id",
|
replaceID: "placeholder-property-id",
|
||||||
multiDisplayMode: PROPERTY_MULTI_DISPLAY_MODE.COMMA_SEPARATED_VALUES,
|
multiDisplayMode: PROPERTY_MULTI_DISPLAY_MODE.COMMA_SEPARATED_VALUES,
|
||||||
},
|
},
|
||||||
/*{
|
{
|
||||||
label: "Description",
|
label: "Description",
|
||||||
type: "string",
|
type: "string",
|
||||||
propertyID: "description",
|
propertyID: "description",
|
||||||
},*/
|
},
|
||||||
{ //THIS IS ONLY FOR THE TEST ##########################################
|
|
||||||
label: "Description",
|
|
||||||
type: "multipleZonesSelection",
|
|
||||||
propertyID: "description",
|
|
||||||
}, // END TEST #############################
|
|
||||||
{
|
{
|
||||||
label: "Parent",
|
label: "Parent",
|
||||||
type: "string",
|
type: "string",
|
||||||
|
@ -120,6 +115,11 @@ const GROUPS = [
|
||||||
lines: "Wireframe",
|
lines: "Wireframe",
|
||||||
},
|
},
|
||||||
propertyID: "primitiveMode",
|
propertyID: "primitiveMode",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: "Render With Zones",
|
||||||
|
type: "multipleZonesSelection",
|
||||||
|
propertyID: "renderWithZones",
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
@ -1903,7 +1903,7 @@ function resetProperties() {
|
||||||
}
|
}
|
||||||
case 'multipleZonesSelection': {
|
case 'multipleZonesSelection': {
|
||||||
property.elInput.classList.remove('multi-diff');
|
property.elInput.classList.remove('multi-diff');
|
||||||
property.elInput.value = "[]"; //################################## PROBABLY SOMETHING TO ADJUST HERE!
|
property.elInput.value = "[]";
|
||||||
setZonesSelectionData(property.elInput, false);
|
setZonesSelectionData(property.elInput, false);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -3588,20 +3588,19 @@ function addZoneToZonesSelection(propertyId) {
|
||||||
let selectedZones = JSON.parse(hiddenField.value);
|
let selectedZones = JSON.parse(hiddenField.value);
|
||||||
let zoneToAdd = document.getElementById("zones-select-" + propertyId).value;
|
let zoneToAdd = document.getElementById("zones-select-" + propertyId).value;
|
||||||
if (!selectedZones.includes(zoneToAdd)) {
|
if (!selectedZones.includes(zoneToAdd)) {
|
||||||
selectedZones.push(zoneToAdd);
|
selectedZones.push(zoneToAdd);
|
||||||
}
|
}
|
||||||
hiddenField.value = JSON.stringify(selectedZones);
|
hiddenField.value = JSON.stringify(selectedZones);
|
||||||
displaySelectedZones(propertyId, true);
|
displaySelectedZones(propertyId, true);
|
||||||
let propertyName = propertyId.replace("property-", "");
|
let propertyName = propertyId.replace("property-", "");
|
||||||
updateProperty(propertyName, JSON.stringify(selectedZones), false); //FOR TEMPORARY STRING FOR TEST
|
updateProperty(propertyName, selectedZones, false);
|
||||||
//updateProperty(propertyName, selectedZones, false); //DIRECTLY FOR ARRY
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function removeZoneFromZonesSelection(propertyId, zoneId) {
|
function removeZoneFromZonesSelection(propertyId, zoneId) {
|
||||||
let hiddenField = document.getElementById(propertyId);
|
let hiddenField = document.getElementById(propertyId);
|
||||||
if(JSON.stringify(hiddenField.value) === '"undefined"') {
|
if(JSON.stringify(hiddenField.value) === '"undefined"') {
|
||||||
hiddenField.value = "[]";
|
hiddenField.value = "[]";
|
||||||
}
|
}
|
||||||
let selectedZones = JSON.parse(hiddenField.value);
|
let selectedZones = JSON.parse(hiddenField.value);
|
||||||
let index = selectedZones.indexOf(zoneId);
|
let index = selectedZones.indexOf(zoneId);
|
||||||
if (index > -1) {
|
if (index > -1) {
|
||||||
|
@ -3610,8 +3609,7 @@ function removeZoneFromZonesSelection(propertyId, zoneId) {
|
||||||
hiddenField.value = JSON.stringify(selectedZones);
|
hiddenField.value = JSON.stringify(selectedZones);
|
||||||
displaySelectedZones(propertyId, true);
|
displaySelectedZones(propertyId, true);
|
||||||
let propertyName = propertyId.replace("property-", "");
|
let propertyName = propertyId.replace("property-", "");
|
||||||
updateProperty(propertyName, JSON.stringify(selectedZones), false); //FOR TEMPORARY STRING FOR TEST
|
updateProperty(propertyName, selectedZones, false);
|
||||||
//updateProperty(propertyName, selectedZones, false); //DIRECTLY FOR ARRY
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function displaySelectedZones(propertyId, isEditable) {
|
function displaySelectedZones(propertyId, isEditable) {
|
||||||
|
@ -3629,7 +3627,7 @@ function displaySelectedZones(propertyId, isEditable) {
|
||||||
if (!isMultiple) {
|
if (!isMultiple) {
|
||||||
listedZoneInner += "<tr><td class='zoneItem'> </td><td> </td></tr>";
|
listedZoneInner += "<tr><td class='zoneItem'> </td><td> </td></tr>";
|
||||||
} else {
|
} else {
|
||||||
listedZoneInner += "<tr><td class='zoneItem'>[ WARNING: Any changes will apply to all ]</td><td> </td></tr>";
|
listedZoneInner += "<tr><td class='zoneItem'>[ WARNING: Any changes will apply to all. ]</td><td> </td></tr>";
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
for ( i = 0; i < selectedZones.length; i++ ) {
|
for ( i = 0; i < selectedZones.length; i++ ) {
|
||||||
|
@ -3645,9 +3643,10 @@ function displaySelectedZones(propertyId, isEditable) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (isEditable) {
|
if (isEditable) {
|
||||||
listedZoneInner += "<tr><td class='zoneItem'>" + name + "</td><td><a href='#' onClick='removeZoneFromZonesSelection(" + '"' + propertyId + '"' + ", " + '"' + selectedZones[i] + '"' + ");' ><img src='../../../html/css/img/remove_icon.png'></a></td></tr>";
|
listedZoneInner += "<tr><td class='zoneItem'>" + name + "</td><td><a href='#' onClick='removeZoneFromZonesSelection(" + '"' + propertyId + '"' + ", " + '"' + selectedZones[i] + '"' + ");' >";
|
||||||
|
listedZoneInner += "<img src='../../../html/css/img/remove_icon.png'></a></td></tr>";
|
||||||
} else {
|
} else {
|
||||||
listedZoneInner += "<tr><td class='zoneItem'>" + name + "</td><td> </td></tr>";
|
listedZoneInner += "<tr><td class='zoneItem'>" + name + "</td><td> </td></tr>";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -3666,7 +3665,7 @@ function createZonesSelection(property, elProperty) {
|
||||||
elProperty.className = "multipleZonesSelection";
|
elProperty.className = "multipleZonesSelection";
|
||||||
let elInput = document.createElement('input');
|
let elInput = document.createElement('input');
|
||||||
elInput.setAttribute("id", elementID);
|
elInput.setAttribute("id", elementID);
|
||||||
elInput.setAttribute("type", "hidden"); // must be hidden ################################################################################# HEIL! ICITTE!
|
elInput.setAttribute("type", "hidden");
|
||||||
elInput.className = "hiddenMultiZonesSelection";
|
elInput.className = "hiddenMultiZonesSelection";
|
||||||
|
|
||||||
let elZonesSelector = document.createElement('div');
|
let elZonesSelector = document.createElement('div');
|
||||||
|
@ -3694,7 +3693,8 @@ function setZonesSelectionData(element, isEditable) {
|
||||||
}
|
}
|
||||||
zoneSelector += "<option value='" + zonesList[i].id + "'>" + name + "</option>";
|
zoneSelector += "<option value='" + zonesList[i].id + "'>" + name + "</option>";
|
||||||
}
|
}
|
||||||
zoneSelector += "</select> <a href='#' id='zones-select-add-" + element.id + "' onClick='addZoneToZonesSelection(" + '"' + element.id + '"' + ");' ><img style='vertical-align:top' src='../../../html/css/img/add_icon.png'></a></div>";
|
zoneSelector += "</select> <a href='#' id='zones-select-add-" + element.id + "' onClick='addZoneToZonesSelection(" + '"' + element.id + '"' + ");' >";
|
||||||
|
zoneSelector += "<img style='vertical-align:top' src='../../../html/css/img/add_icon.png'></a></div>";
|
||||||
zoneSelector += "<div class='selected-zone-container' id='selected-zones-" + element.id + "'></div>";
|
zoneSelector += "<div class='selected-zone-container' id='selected-zones-" + element.id + "'></div>";
|
||||||
zoneSelectorContainer.innerHTML = zoneSelector;
|
zoneSelectorContainer.innerHTML = zoneSelector;
|
||||||
displaySelectedZones(element.id, isEditable);
|
displaySelectedZones(element.id, isEditable);
|
||||||
|
@ -4108,18 +4108,14 @@ function handleEntitySelectionUpdate(selections, isPropertiesToolUpdate) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case 'multipleZonesSelection': {
|
case 'multipleZonesSelection': {
|
||||||
if (propertyValue == ""){ //THIS IS A PATCH FOR TESTING WITh A STRING FIELDS
|
property.elInput.value = JSON.stringify(propertyValue);
|
||||||
property.elInput.value = "[]"; //THIS IS A PATCH FOR TESTING WITh A STRING FIELDS
|
|
||||||
} else { //THIS IS A PATCH FOR TESTING WITh A STRING FIELDS
|
|
||||||
property.elInput.value = propertyValue; //JSON.stringify(propertyValue); //##### TO CHECK depending what type the value is.. expecting an array so it willbe manage as a string.
|
|
||||||
} //THIS IS A PATCH FOR TESTING WITh A STRING FIELDS
|
|
||||||
if (lockedMultiValue.isMultiDiffValue || lockedMultiValue.value) {
|
if (lockedMultiValue.isMultiDiffValue || lockedMultiValue.value) {
|
||||||
setZonesSelectionData(property.elInput, false);
|
setZonesSelectionData(property.elInput, false);
|
||||||
} else {
|
} else {
|
||||||
setZonesSelectionData(property.elInput, true);
|
setZonesSelectionData(property.elInput, true);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case 'icon': {
|
case 'icon': {
|
||||||
property.elSpan.innerHTML = propertyData.icons[propertyValue];
|
property.elSpan.innerHTML = propertyData.icons[propertyValue];
|
||||||
property.elSpan.style.display = "inline-block";
|
property.elSpan.style.display = "inline-block";
|
||||||
|
|
Loading…
Reference in a new issue