mirror of
https://github.com/lubosz/overte.git
synced 2025-08-07 19:41:20 +02:00
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.
This commit is contained in:
parent
d934018c7b
commit
8ab40e1a08
1 changed files with 2 additions and 50 deletions
|
@ -1741,12 +1741,6 @@ function disableChildren(el, selector) {
|
||||||
function enableProperties() {
|
function enableProperties() {
|
||||||
enableChildren(document.getElementById("properties-list"), ENABLE_DISABLE_SELECTOR);
|
enableChildren(document.getElementById("properties-list"), ENABLE_DISABLE_SELECTOR);
|
||||||
enableChildren(document, ".colpick");
|
enableChildren(document, ".colpick");
|
||||||
|
|
||||||
let elLocked = getPropertyInputElement("locked");
|
|
||||||
if (elLocked.checked === false) {
|
|
||||||
removeStaticUserData();
|
|
||||||
removeStaticMaterialData();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function disableProperties() {
|
function disableProperties() {
|
||||||
|
@ -1755,16 +1749,6 @@ function disableProperties() {
|
||||||
for (let pickKey in colorPickers) {
|
for (let pickKey in colorPickers) {
|
||||||
colorPickers[pickKey].colpickHide();
|
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) {
|
function showPropertyElement(propertyID, show) {
|
||||||
|
@ -3217,19 +3201,6 @@ function hideUserDataSaved() {
|
||||||
$('#property-userData-saved').hide();
|
$('#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) {
|
function setEditorJSON(json) {
|
||||||
editor.set(json);
|
editor.set(json);
|
||||||
if (editor.hasOwnProperty('expandAll')) {
|
if (editor.hasOwnProperty('expandAll')) {
|
||||||
|
@ -3382,19 +3353,6 @@ function hideMaterialDataSaved() {
|
||||||
$('#property-materialData-saved').hide();
|
$('#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) {
|
function setMaterialEditorJSON(json) {
|
||||||
materialEditor.set(json);
|
materialEditor.set(json);
|
||||||
if (materialEditor.hasOwnProperty('expandAll')) {
|
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) {
|
if (editor === null) {
|
||||||
createJSONEditor();
|
createJSONEditor();
|
||||||
}
|
}
|
||||||
|
@ -3967,7 +3925,7 @@ function handleEntitySelectionUpdate(selections, isPropertiesToolUpdate) {
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (materialJson !== null) {
|
if (materialJson !== null && !lockedMultiValue.isMultiDiffValue && !lockedMultiValue.value) {
|
||||||
if (materialEditor === null) {
|
if (materialEditor === null) {
|
||||||
createJSONMaterialEditor();
|
createJSONMaterialEditor();
|
||||||
}
|
}
|
||||||
|
@ -4255,8 +4213,6 @@ function loaded() {
|
||||||
let elUserData = userDataProperty.elInput;
|
let elUserData = userDataProperty.elInput;
|
||||||
let userDataElementID = userDataProperty.elementID;
|
let userDataElementID = userDataProperty.elementID;
|
||||||
elDiv = elUserData.parentNode;
|
elDiv = elUserData.parentNode;
|
||||||
let elStaticUserData = document.createElement('div');
|
|
||||||
elStaticUserData.setAttribute("id", userDataElementID + "-static");
|
|
||||||
let elUserDataEditor = document.createElement('div');
|
let elUserDataEditor = document.createElement('div');
|
||||||
elUserDataEditor.setAttribute("id", userDataElementID + "-editor");
|
elUserDataEditor.setAttribute("id", userDataElementID + "-editor");
|
||||||
let elUserDataEditorStatus = document.createElement('div');
|
let elUserDataEditorStatus = document.createElement('div');
|
||||||
|
@ -4265,7 +4221,6 @@ function loaded() {
|
||||||
elUserDataSaved.setAttribute("id", userDataElementID + "-saved");
|
elUserDataSaved.setAttribute("id", userDataElementID + "-saved");
|
||||||
elUserDataSaved.innerText = "Saved!";
|
elUserDataSaved.innerText = "Saved!";
|
||||||
elDiv.childNodes[JSON_EDITOR_ROW_DIV_INDEX].appendChild(elUserDataSaved);
|
elDiv.childNodes[JSON_EDITOR_ROW_DIV_INDEX].appendChild(elUserDataSaved);
|
||||||
elDiv.insertBefore(elStaticUserData, elUserData);
|
|
||||||
elDiv.insertBefore(elUserDataEditor, elUserData);
|
elDiv.insertBefore(elUserDataEditor, elUserData);
|
||||||
elDiv.insertBefore(elUserDataEditorStatus, elUserData);
|
elDiv.insertBefore(elUserDataEditorStatus, elUserData);
|
||||||
|
|
||||||
|
@ -4274,8 +4229,6 @@ function loaded() {
|
||||||
let elMaterialData = materialDataProperty.elInput;
|
let elMaterialData = materialDataProperty.elInput;
|
||||||
let materialDataElementID = materialDataProperty.elementID;
|
let materialDataElementID = materialDataProperty.elementID;
|
||||||
elDiv = elMaterialData.parentNode;
|
elDiv = elMaterialData.parentNode;
|
||||||
let elStaticMaterialData = document.createElement('div');
|
|
||||||
elStaticMaterialData.setAttribute("id", materialDataElementID + "-static");
|
|
||||||
let elMaterialDataEditor = document.createElement('div');
|
let elMaterialDataEditor = document.createElement('div');
|
||||||
elMaterialDataEditor.setAttribute("id", materialDataElementID + "-editor");
|
elMaterialDataEditor.setAttribute("id", materialDataElementID + "-editor");
|
||||||
let elMaterialDataEditorStatus = document.createElement('div');
|
let elMaterialDataEditorStatus = document.createElement('div');
|
||||||
|
@ -4284,7 +4237,6 @@ function loaded() {
|
||||||
elMaterialDataSaved.setAttribute("id", materialDataElementID + "-saved");
|
elMaterialDataSaved.setAttribute("id", materialDataElementID + "-saved");
|
||||||
elMaterialDataSaved.innerText = "Saved!";
|
elMaterialDataSaved.innerText = "Saved!";
|
||||||
elDiv.childNodes[JSON_EDITOR_ROW_DIV_INDEX].appendChild(elMaterialDataSaved);
|
elDiv.childNodes[JSON_EDITOR_ROW_DIV_INDEX].appendChild(elMaterialDataSaved);
|
||||||
elDiv.insertBefore(elStaticMaterialData, elMaterialData);
|
|
||||||
elDiv.insertBefore(elMaterialDataEditor, elMaterialData);
|
elDiv.insertBefore(elMaterialDataEditor, elMaterialData);
|
||||||
elDiv.insertBefore(elMaterialDataEditorStatus, elMaterialData);
|
elDiv.insertBefore(elMaterialDataEditorStatus, elMaterialData);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue