mirror of
https://github.com/lubosz/overte.git
synced 2025-08-07 18:41:10 +02:00
Merge pull request #12012 from Delanir/Case10633
Cases 10632 and 10633 Particle Explorer UI
This commit is contained in:
commit
933720fb10
4 changed files with 28 additions and 10 deletions
|
@ -261,15 +261,18 @@ HifiEntityUI.prototype = {
|
||||||
addSection: function (parent, section, properties, index) {
|
addSection: function (parent, section, properties, index) {
|
||||||
var self = this;
|
var self = this;
|
||||||
|
|
||||||
var sectionDivHeader = document.createElement("div");
|
var sectionDivHeader = document.createElement("fieldset");
|
||||||
var title = document.createElement("label");
|
var title = document.createElement("legend");
|
||||||
var dropDown = document.createElement("span");
|
var dropDown = document.createElement("span");
|
||||||
|
|
||||||
dropDown.className = "arrow";
|
dropDown.className = "arrow";
|
||||||
sectionDivHeader.className = "section-header";
|
sectionDivHeader.className = "major";
|
||||||
|
title.className = "section-header";
|
||||||
|
title.id = section + "-section";
|
||||||
title.innerHTML = section;
|
title.innerHTML = section;
|
||||||
|
title.appendChild(dropDown);
|
||||||
sectionDivHeader.appendChild(title);
|
sectionDivHeader.appendChild(title);
|
||||||
sectionDivHeader.appendChild(dropDown);
|
|
||||||
var collapsed = index !== 0;
|
var collapsed = index !== 0;
|
||||||
|
|
||||||
dropDown.innerHTML = collapsed ? "L" : "M";
|
dropDown.innerHTML = collapsed ? "L" : "M";
|
||||||
|
@ -292,7 +295,7 @@ HifiEntityUI.prototype = {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
sectionDivBody.appendChild(animationWrapper);
|
sectionDivBody.appendChild(animationWrapper);
|
||||||
parent.appendChild(sectionDivBody);
|
sectionDivHeader.appendChild(sectionDivBody);
|
||||||
_.defer(function () {
|
_.defer(function () {
|
||||||
var height = (animationWrapper.clientHeight) + "px";
|
var height = (animationWrapper.clientHeight) + "px";
|
||||||
if (collapsed) {
|
if (collapsed) {
|
||||||
|
@ -303,7 +306,7 @@ HifiEntityUI.prototype = {
|
||||||
sectionDivBody.style.maxHeight = height;
|
sectionDivBody.style.maxHeight = height;
|
||||||
}
|
}
|
||||||
|
|
||||||
sectionDivHeader.onclick = function () {
|
title.onclick = function () {
|
||||||
collapsed = !collapsed;
|
collapsed = !collapsed;
|
||||||
if (collapsed) {
|
if (collapsed) {
|
||||||
sectionDivBody.classList.remove("visible");
|
sectionDivBody.classList.remove("visible");
|
||||||
|
@ -314,7 +317,7 @@ HifiEntityUI.prototype = {
|
||||||
}
|
}
|
||||||
// sectionDivBody.style.display = collapsed ? "none": "block";
|
// sectionDivBody.style.display = collapsed ? "none": "block";
|
||||||
dropDown.innerHTML = collapsed ? "L" : "M";
|
dropDown.innerHTML = collapsed ? "L" : "M";
|
||||||
sectionDivHeader.setAttribute("collapsed", collapsed);
|
title.setAttribute("collapsed", collapsed);
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
File diff suppressed because one or more lines are too long
|
@ -30,8 +30,8 @@
|
||||||
<link rel="stylesheet" type="text/css" href="particle-style.css">
|
<link rel="stylesheet" type="text/css" href="particle-style.css">
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<div id="particle-explorer">
|
<div id="properties-list">
|
||||||
<div class="section-header">
|
<div class="section-header" id="main-header">
|
||||||
<label> Particle Explorer </label>
|
<label> Particle Explorer </label>
|
||||||
</div>
|
</div>
|
||||||
<!-- This will be filled by the script! -->
|
<!-- This will be filled by the script! -->
|
||||||
|
|
|
@ -5,6 +5,7 @@
|
||||||
// Copyright 2017 High Fidelity, Inc.
|
// Copyright 2017 High Fidelity, Inc.
|
||||||
//
|
//
|
||||||
// Reworked by Menithal on 20/5/2017
|
// Reworked by Menithal on 20/5/2017
|
||||||
|
// Reworked by Daniela Fontes and Artur Gomes (Mimicry) on 12/18/2017
|
||||||
//
|
//
|
||||||
// Web app side of the App - contains GUI.
|
// Web app side of the App - contains GUI.
|
||||||
// This is an example of a new, easy way to do two way bindings between dynamically created GUI and in-world entities.
|
// This is an example of a new, easy way to do two way bindings between dynamically created GUI and in-world entities.
|
||||||
|
@ -17,7 +18,7 @@
|
||||||
|
|
||||||
(function () {
|
(function () {
|
||||||
|
|
||||||
var root = document.getElementById("particle-explorer");
|
var root = document.getElementById("properties-list");
|
||||||
|
|
||||||
window.onload = function () {
|
window.onload = function () {
|
||||||
var ui = new HifiEntityUI(root);
|
var ui = new HifiEntityUI(root);
|
||||||
|
@ -51,6 +52,7 @@
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
textarea.oninput = textarea.onchange;
|
textarea.oninput = textarea.onchange;
|
||||||
|
document.getElementById("show-properties-button").value = "Hide Properties";
|
||||||
} else {
|
} else {
|
||||||
textarea.onchange = function () {};
|
textarea.onchange = function () {};
|
||||||
textarea.oninput = textarea.onchange;
|
textarea.oninput = textarea.onchange;
|
||||||
|
@ -60,6 +62,7 @@
|
||||||
insertZone.parentNode.clientHeight + "px";
|
insertZone.parentNode.clientHeight + "px";
|
||||||
document.getElementById("export-properties-button").setAttribute("disabled", true);
|
document.getElementById("export-properties-button").setAttribute("disabled", true);
|
||||||
document.getElementById("import-properties-button").setAttribute("disabled", true);
|
document.getElementById("import-properties-button").setAttribute("disabled", true);
|
||||||
|
document.getElementById("show-properties-button").value = "Show Properties";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
Loading…
Reference in a new issue