From 8ab40e1a0832c2a064327c8a20ff572d93748e60 Mon Sep 17 00:00:00 2001 From: Alezia Kurdis <60075796+AleziaKurdis@users.noreply.github.com> Date: Tue, 10 Mar 2020 00:48:54 -0400 Subject: [PATCH] Fix the userData and materialData editor Fix the userData and materialData editor. Only 2 conditions have been modified to make it works. I have removed a significant quantity of dead code that was trying to overlay a static text an obscure reason. Please, retest this. In case I missed something that I don't know. --- .../html/js/entityProperties.js | 52 +------------------ 1 file changed, 2 insertions(+), 50 deletions(-) diff --git a/scripts/system/create/entityProperties/html/js/entityProperties.js b/scripts/system/create/entityProperties/html/js/entityProperties.js index 26eb94e8da..9e476d80aa 100644 --- a/scripts/system/create/entityProperties/html/js/entityProperties.js +++ b/scripts/system/create/entityProperties/html/js/entityProperties.js @@ -1741,12 +1741,6 @@ function disableChildren(el, selector) { function enableProperties() { enableChildren(document.getElementById("properties-list"), ENABLE_DISABLE_SELECTOR); enableChildren(document, ".colpick"); - - let elLocked = getPropertyInputElement("locked"); - if (elLocked.checked === false) { - removeStaticUserData(); - removeStaticMaterialData(); - } } function disableProperties() { @@ -1755,16 +1749,6 @@ function disableProperties() { for (let pickKey in colorPickers) { colorPickers[pickKey].colpickHide(); } - - let elLocked = getPropertyInputElement("locked"); - if (elLocked.checked === true) { - if ($('#property-userData-editor').css('display') === "block") { - showStaticUserData(); - } - if ($('#property-materialData-editor').css('display') === "block") { - showStaticMaterialData(); - } - } } function showPropertyElement(propertyID, show) { @@ -3217,19 +3201,6 @@ function hideUserDataSaved() { $('#property-userData-saved').hide(); } -function showStaticUserData() { - if (editor !== null) { - let $propertyUserDataStatic = $('#property-userData-static'); - $propertyUserDataStatic.show(); - $propertyUserDataStatic.css('height', $('#property-userData-editor').height()); - $propertyUserDataStatic.text(editor.getText()); - } -} - -function removeStaticUserData() { - $('#property-userData-static').hide(); -} - function setEditorJSON(json) { editor.set(json); if (editor.hasOwnProperty('expandAll')) { @@ -3382,19 +3353,6 @@ function hideMaterialDataSaved() { $('#property-materialData-saved').hide(); } -function showStaticMaterialData() { - if (materialEditor !== null) { - let $propertyMaterialDataStatic = $('#property-materialData-static'); - $propertyMaterialDataStatic.show(); - $propertyMaterialDataStatic.css('height', $('#property-materialData-editor').height()); - $propertyMaterialDataStatic.text(materialEditor.getText()); - } -} - -function removeStaticMaterialData() { - $('#property-materialData-static').hide(); -} - function setMaterialEditorJSON(json) { materialEditor.set(json); if (materialEditor.hasOwnProperty('expandAll')) { @@ -3935,7 +3893,7 @@ function handleEntitySelectionUpdate(selections, isPropertiesToolUpdate) { } } - if (json !== null) { + if (json !== null && !lockedMultiValue.isMultiDiffValue && !lockedMultiValue.value) { if (editor === null) { createJSONEditor(); } @@ -3967,7 +3925,7 @@ function handleEntitySelectionUpdate(selections, isPropertiesToolUpdate) { } } - if (materialJson !== null) { + if (materialJson !== null && !lockedMultiValue.isMultiDiffValue && !lockedMultiValue.value) { if (materialEditor === null) { createJSONMaterialEditor(); } @@ -4255,8 +4213,6 @@ function loaded() { let elUserData = userDataProperty.elInput; let userDataElementID = userDataProperty.elementID; elDiv = elUserData.parentNode; - let elStaticUserData = document.createElement('div'); - elStaticUserData.setAttribute("id", userDataElementID + "-static"); let elUserDataEditor = document.createElement('div'); elUserDataEditor.setAttribute("id", userDataElementID + "-editor"); let elUserDataEditorStatus = document.createElement('div'); @@ -4265,7 +4221,6 @@ function loaded() { elUserDataSaved.setAttribute("id", userDataElementID + "-saved"); elUserDataSaved.innerText = "Saved!"; elDiv.childNodes[JSON_EDITOR_ROW_DIV_INDEX].appendChild(elUserDataSaved); - elDiv.insertBefore(elStaticUserData, elUserData); elDiv.insertBefore(elUserDataEditor, elUserData); elDiv.insertBefore(elUserDataEditorStatus, elUserData); @@ -4274,8 +4229,6 @@ function loaded() { let elMaterialData = materialDataProperty.elInput; let materialDataElementID = materialDataProperty.elementID; elDiv = elMaterialData.parentNode; - let elStaticMaterialData = document.createElement('div'); - elStaticMaterialData.setAttribute("id", materialDataElementID + "-static"); let elMaterialDataEditor = document.createElement('div'); elMaterialDataEditor.setAttribute("id", materialDataElementID + "-editor"); let elMaterialDataEditorStatus = document.createElement('div'); @@ -4284,7 +4237,6 @@ function loaded() { elMaterialDataSaved.setAttribute("id", materialDataElementID + "-saved"); elMaterialDataSaved.innerText = "Saved!"; elDiv.childNodes[JSON_EDITOR_ROW_DIV_INDEX].appendChild(elMaterialDataSaved); - elDiv.insertBefore(elStaticMaterialData, elMaterialData); elDiv.insertBefore(elMaterialDataEditor, elMaterialData); elDiv.insertBefore(elMaterialDataEditorStatus, elMaterialData);