mirror of
https://github.com/JulianGro/overte.git
synced 2025-04-25 18:55:01 +02:00
tweaks / dropdown fix
This commit is contained in:
parent
4c4949149a
commit
62c5fb8e2e
1 changed files with 15 additions and 17 deletions
|
@ -1383,7 +1383,7 @@ function createColorProperty(property, elProperty, elLabel) {
|
|||
return [elColorPicker, elInputR, elInputG, elInputB];
|
||||
}
|
||||
|
||||
function createDropdownProperty(property, elProperty, elLabel) {
|
||||
function createDropdownProperty(property, propertyID, elProperty, elLabel) {
|
||||
let propertyName = property.name;
|
||||
let elementID = property.elementID;
|
||||
let propertyData = property.data;
|
||||
|
@ -1392,7 +1392,7 @@ function createDropdownProperty(property, elProperty, elLabel) {
|
|||
|
||||
let elInput = document.createElement('select');
|
||||
elInput.setAttribute("id", elementID);
|
||||
elInput.setAttribute("propertyID", propertyData.propertyID);
|
||||
elInput.setAttribute("propertyID", propertyID);
|
||||
|
||||
for (let optionKey in propertyData.options) {
|
||||
let option = document.createElement('option');
|
||||
|
@ -2015,7 +2015,7 @@ function bindAllNonJSONEditorElements() {
|
|||
}
|
||||
|
||||
|
||||
// DROPDOWNS / TEXTAREAS / PARENT MATERIAL NAME FUNCTIONS
|
||||
// DROPDOWN FUNCTIONS
|
||||
|
||||
function setDropdownText(dropdown) {
|
||||
let lis = dropdown.parentNode.getElementsByTagName("li");
|
||||
|
@ -2050,6 +2050,9 @@ function setDropdownValue(event) {
|
|||
dt.dispatchEvent(evt);
|
||||
}
|
||||
|
||||
|
||||
// TEXTAREA / PARENT MATERIAL NAME FUNCTIONS
|
||||
|
||||
function setTextareaScrolling(element) {
|
||||
var isScrolling = element.scrollHeight > element.offsetHeight;
|
||||
element.setAttribute("scrolling", isScrolling ? "true" : "false");
|
||||
|
@ -2169,7 +2172,7 @@ function loaded() {
|
|||
break;
|
||||
}
|
||||
case 'dropdown': {
|
||||
properties[propertyID].el = createDropdownProperty(property, elProperty, elLabel);
|
||||
properties[propertyID].el = createDropdownProperty(property, propertyID, elProperty, elLabel);
|
||||
break;
|
||||
}
|
||||
case 'textarea': {
|
||||
|
@ -2252,10 +2255,6 @@ function loaded() {
|
|||
}
|
||||
|
||||
resetProperties();
|
||||
|
||||
getPropertyElement("type")[0].style.display = "none";
|
||||
getPropertyElement("type")[1].innerHTML = NO_SELECTION;
|
||||
elPropertiesList.className = '';
|
||||
showGroupsForType("None");
|
||||
|
||||
deleteJSONEditor();
|
||||
|
@ -2297,17 +2296,20 @@ function loaded() {
|
|||
}
|
||||
|
||||
resetProperties();
|
||||
|
||||
getPropertyElement("type")[0].innerHTML = ICON_FOR_TYPE[type];
|
||||
getPropertyElement("type")[0].style.display = "inline-block";
|
||||
getPropertyElement("type")[1].innerHTML = type + " (" + data.selections.length + ")";
|
||||
elPropertiesList.className = '';
|
||||
showGroupsForType(type);
|
||||
|
||||
let typeProperty = properties["type"];
|
||||
let elTypeProperty = typeProperty.el;
|
||||
elTypeProperty[0].innerHTML = typeProperty.data.icons[type];
|
||||
elTypeProperty[0].style.display = "inline-block";
|
||||
elTypeProperty[1].innerHTML = type + " (" + data.selections.length + ")";
|
||||
|
||||
disableProperties();
|
||||
} else {
|
||||
selectedEntityProperties = data.selections[0].properties;
|
||||
|
||||
showGroupsForType(selectedEntityProperties.type);
|
||||
|
||||
if (lastEntityID !== '"' + selectedEntityProperties.id + '"' && lastEntityID !== null) {
|
||||
if (editor !== null) {
|
||||
saveUserData();
|
||||
|
@ -2333,10 +2335,6 @@ function loaded() {
|
|||
}
|
||||
}
|
||||
|
||||
// Create class name for css ruleset filtering
|
||||
elPropertiesList.className = selectedEntityProperties.type + 'Menu';
|
||||
showGroupsForType(selectedEntityProperties.type);
|
||||
|
||||
for (let propertyID in properties) {
|
||||
let property = properties[propertyID];
|
||||
let elProperty = property.el;
|
||||
|
|
Loading…
Reference in a new issue