From aecbccc058ded3c01a6af33a9f3bf03a335fa643 Mon Sep 17 00:00:00 2001 From: Ryan Huffman Date: Mon, 12 Nov 2018 12:28:11 -0800 Subject: [PATCH] Remove dead code and cleanup JS styling for entity properties redesign --- scripts/system/html/css/edit-style.css | 23 ------------------ scripts/system/html/js/entityProperties.js | 28 +++++----------------- 2 files changed, 6 insertions(+), 45 deletions(-) diff --git a/scripts/system/html/css/edit-style.css b/scripts/system/html/css/edit-style.css index c09655b451..aa7ed821c1 100644 --- a/scripts/system/html/css/edit-style.css +++ b/scripts/system/html/css/edit-style.css @@ -1411,29 +1411,6 @@ th#entity-hasScript { display: inline-block; } -/* -#properties-base #div-property-locked { - position: absolute; - top: 6px; - right: 140px; - display: table-cell; - vertical-align: middle; -} - -#properties-base #div-property-visible { - position: absolute; - top: 26px; - right: 20px; - display: table-cell; - vertical-align: middle; -} - -#properties-base #div-property-locked label, -#properties-base #div-property-visible label { - background-position-y: 1px; -} -*/ - #properties-base .checkbox label span { font-family: HiFi-Glyphs; font-size: 20px; diff --git a/scripts/system/html/js/entityProperties.js b/scripts/system/html/js/entityProperties.js index bfd95410ce..e05ca3ee60 100644 --- a/scripts/system/html/js/entityProperties.js +++ b/scripts/system/html/js/entityProperties.js @@ -1116,7 +1116,6 @@ const GROUPS = [ }, { label: "Clone Lifetime", - indentedLabel: true, type: "number", unit: "s", propertyID: "cloneLifetime", @@ -1124,21 +1123,18 @@ const GROUPS = [ }, { label: "Clone Limit", - indentedLabel: true, type: "number", propertyID: "cloneLimit", showPropertyRule: { "cloneable": "true" }, }, { label: "Clone Dynamic", - indentedLabel: true, type: "bool", propertyID: "cloneDynamic", showPropertyRule: { "cloneable": "true" }, }, { label: "Clone Avatar Entity", - indentedLabel: true, type: "bool", propertyID: "cloneAvatarEntity", showPropertyRule: { "cloneable": "true" }, @@ -1417,7 +1413,7 @@ var createAppTooltip = new CreateAppTooltip(); let currentSpaceMode = PROPERTY_SPACE_MODE.LOCAL; function createElementFromHTML(htmlString) { - var elTemplate = document.createElement('template'); + let elTemplate = document.createElement('template'); elTemplate.innerHTML = htmlString.trim(); return elTemplate.content.firstChild; } @@ -1916,11 +1912,6 @@ function createVec3Property(property, elProperty) { elProperty.className = propertyData.vec3Type + " fstuple"; - //let elTuple = document.createElement('div'); - //elTuple.className = "tuple"; - - //elProperty.appendChild(elTuple); - let elInputX = createTupleNumberInput(elProperty, elementID, propertyData.subLabels[VECTOR_ELEMENTS.X_INPUT], propertyData.min, propertyData.max, propertyData.step); let elInputY = createTupleNumberInput(elProperty, elementID, propertyData.subLabels[VECTOR_ELEMENTS.Y_INPUT], @@ -2089,9 +2080,7 @@ function createIconProperty(property, elProperty) { elProperty.appendChild(elSpan); - let elResult = []; - elResult[ICON_ELEMENTS.ICON] = elSpan; - return elResult; + return elSpan; } function createTextureProperty(property, elProperty) { @@ -2154,9 +2143,6 @@ function createButtonsProperty(property, elProperty, elLabel) { elProperty.className = "text"; let hasLabel = propertyData.label !== undefined; - if (hasLabel) { - } - if (propertyData.buttons !== undefined) { addButtons(elProperty, elementID, propertyData.buttons, hasLabel); } @@ -2803,9 +2789,7 @@ function createProperty(propertyData, propertyElementID, propertyName, propertyI break; } case 'icon': { - let elIcon = createIconProperty(property, elProperty); - property.elSpan = elIcon[ICON_ELEMENTS.ICON]; - property.elLabel = elIcon[ICON_ELEMENTS.LABEL]; + property.elSpan = createIconProperty(property, elProperty); break; } case 'texture': { @@ -2824,7 +2808,7 @@ function createProperty(propertyData, propertyElementID, propertyName, propertyI } default: { console.log("EntityProperties - Unknown property type " + - propertyType + " set to property " + propertyID); + propertyType + " set to property " + propertyID); break; } } @@ -2930,9 +2914,9 @@ function loaded() { let elProperty = createElementFromHTML('
'); elContainer.appendChild(elProperty); - if (propertyType == 'triple') { + if (propertyType === 'triple') { elProperty.className = 'flex-row'; - for (var i = 0; i < propertyData.properties.length; ++i) { + for (let i = 0; i < propertyData.properties.length; ++i) { let innerPropertyData = propertyData.properties[i]; let elWrapper = createElementFromHTML('
');