From 896a34212b455ca8ab3ba9bb1593e93a76a0eae5 Mon Sep 17 00:00:00 2001 From: Ryan Huffman Date: Fri, 5 Dec 2014 15:27:24 -0800 Subject: [PATCH] Fix sections not properly updating in properties tool --- examples/html/entityProperties.html | 202 +++++++++++++++------------- 1 file changed, 106 insertions(+), 96 deletions(-) diff --git a/examples/html/entityProperties.html b/examples/html/entityProperties.html index 97e16fcf11..0308d7f5e7 100644 --- a/examples/html/entityProperties.html +++ b/examples/html/entityProperties.html @@ -104,12 +104,12 @@ var elCollisionsWillMove = document.getElementById("property-collisions-will-move"); var elLifetime = document.getElementById("property-lifetime"); - var elBoxSection = document.getElementById("box-section"); + var elBoxSections = document.querySelectorAll(".box-section"); var elBoxColorRed = document.getElementById("property-box-red"); var elBoxColorGreen = document.getElementById("property-box-green"); var elBoxColorBlue = document.getElementById("property-box-blue"); - var elLightSection = document.getElementById('light-section'); + var elLightSections = document.querySelectorAll(".light-section"); var elLightSpotLight = document.getElementById("property-light-spot-light"); var elLightDiffuseRed = document.getElementById("property-light-diffuse-red"); var elLightDiffuseGreen = document.getElementById("property-light-diffuse-green"); @@ -129,14 +129,14 @@ var elLightExponent = document.getElementById("property-light-exponent"); var elLightCutoff = document.getElementById("property-light-cutoff"); - var elModelSection = document.getElementById("model-section"); + var elModelSections = document.querySelectorAll(".model-section"); var elModelURL = document.getElementById("property-model-url"); var elModelAnimationURL = document.getElementById("property-model-animation-url"); var elModelAnimationPlaying = document.getElementById("property-model-animation-playing"); var elModelAnimationFPS = document.getElementById("property-model-animation-fps"); var elModelAnimationFrame = document.getElementById("property-model-animation-frame"); - var elTextSection = document.getElementById("text-section"); + var elTextSections = document.querySelectorAll(".text-section"); var elTextText = document.getElementById("property-text-text"); var elTextLineHeight = document.getElementById("property-text-line-height"); var elTextTextColorRed = document.getElementById("property-text-text-color-red"); @@ -200,9 +200,13 @@ elLifetime.value = properties.lifetime; if (properties.type != "Box") { - elBoxSection.style.display = 'none'; + for (var i = 0; i < elBoxSections.length; i++) { + elBoxSections[i].style.display = 'none'; + } } else { - elBoxSection.style.display = 'block'; + for (var i = 0; i < elBoxSections.length; i++) { + elBoxSections[i].style.display = 'table-row'; + } elBoxColorRed.value = properties.color.red; elBoxColorGreen.value = properties.color.green; @@ -210,9 +214,14 @@ } if (properties.type != "Model") { - elModelSection.style.display = 'none'; + for (var i = 0; i < elModelSections.length; i++) { + elModelSections[i].style.display = 'none'; + } } else { - elModelSection.style.display = 'block'; + for (var i = 0; i < elModelSections.length; i++) { + elModelSections[i].style.display = 'table-row'; + } + elModelURL.value = properties.modelURL; elModelAnimationURL.value = properties.animationURL; elModelAnimationPlaying.checked = properties.animationIsPlaying; @@ -220,9 +229,13 @@ } if (properties.type != "Text") { - elTextSection.style.display = 'none'; + for (var i = 0; i < elTextSections.length; i++) { + elTextSections[i].style.display = 'none'; + } } else { - elTextSection.style.display = 'block'; + for (var i = 0; i < elTextSections.length; i++) { + elTextSections[i].style.display = 'table-row'; + } elTextText.value = properties.text; elTextLineHeight.value = properties.lineHeight; @@ -235,9 +248,13 @@ } if (properties.type != "Light") { - elLightSection.style.display = 'none'; + for (var i = 0; i < elLightSections.length; i++) { + elLightSections[i].style.display = 'none'; + } } else { - elLightSection.style.display = 'block'; + for (var i = 0; i < elLightSections.length; i++) { + elLightSections[i].style.display = 'table-row'; + } elLightDiffuseRed.value = properties.diffuseColor.red; elLightDiffuseGreen.value = properties.diffuseColor.green; @@ -437,7 +454,7 @@ - + Position @@ -446,7 +463,7 @@
Y
Z
- + Registration @@ -455,55 +472,45 @@
Y
Z
- + - Width + Dimensions - +
X
+
Y
+
Z
- - - Height - - - - - - Depth - - - - + - Linear + Linear Velocity
X
Y
Z
- + Linear Damping + - - Angular + Angular Velocity
Pitch
Yaw
Roll
- + Angular Damping - + Gravity @@ -512,168 +519,171 @@
Y
Z
- + Mass - + Ignore For Collisions - + Collisions Will Move - + Lifetime + + - + Color -
Red
-
Green
-
Blue
+
R
+
G
+
B
- + - + Model URL - - + + Animation URL - - + + Animation Playing - - + + Animation FPS - - + + Animation Frame - + - + + Text - - + + Line Height - - + + Text Color -
Red
-
Green
-
Blue
+
R
+
G
+
B
- - + + Background Color -
Red
-
Green
-
Blue
+
R
+
G
+
B
- + - + Spot Light - - + + Diffuse -
Red
-
Green
-
Blue
+
R
+
G
+
B
- - + + Ambient -
Red
-
Green
-
Blue
+
R
+
G
+
B
- - + + Specular -
Red
-
Green
-
Blue
+
R
+
G
+
B
- - + + Constant Attenuation - - + + Linear Attenuation - - + + Quadratic Attenuation - - + + Exponent - - + + Cutoff (degrees) - +