mirror of
https://github.com/lubosz/overte.git
synced 2025-04-23 20:54:25 +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) {
|
||||
var self = this;
|
||||
|
||||
var sectionDivHeader = document.createElement("div");
|
||||
var title = document.createElement("label");
|
||||
var sectionDivHeader = document.createElement("fieldset");
|
||||
var title = document.createElement("legend");
|
||||
var dropDown = document.createElement("span");
|
||||
|
||||
dropDown.className = "arrow";
|
||||
sectionDivHeader.className = "section-header";
|
||||
sectionDivHeader.className = "major";
|
||||
title.className = "section-header";
|
||||
title.id = section + "-section";
|
||||
title.innerHTML = section;
|
||||
title.appendChild(dropDown);
|
||||
sectionDivHeader.appendChild(title);
|
||||
sectionDivHeader.appendChild(dropDown);
|
||||
|
||||
var collapsed = index !== 0;
|
||||
|
||||
dropDown.innerHTML = collapsed ? "L" : "M";
|
||||
|
@ -292,7 +295,7 @@ HifiEntityUI.prototype = {
|
|||
}
|
||||
}
|
||||
sectionDivBody.appendChild(animationWrapper);
|
||||
parent.appendChild(sectionDivBody);
|
||||
sectionDivHeader.appendChild(sectionDivBody);
|
||||
_.defer(function () {
|
||||
var height = (animationWrapper.clientHeight) + "px";
|
||||
if (collapsed) {
|
||||
|
@ -303,7 +306,7 @@ HifiEntityUI.prototype = {
|
|||
sectionDivBody.style.maxHeight = height;
|
||||
}
|
||||
|
||||
sectionDivHeader.onclick = function () {
|
||||
title.onclick = function () {
|
||||
collapsed = !collapsed;
|
||||
if (collapsed) {
|
||||
sectionDivBody.classList.remove("visible");
|
||||
|
@ -314,7 +317,7 @@ HifiEntityUI.prototype = {
|
|||
}
|
||||
// sectionDivBody.style.display = collapsed ? "none": "block";
|
||||
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">
|
||||
</head>
|
||||
<body>
|
||||
<div id="particle-explorer">
|
||||
<div class="section-header">
|
||||
<div id="properties-list">
|
||||
<div class="section-header" id="main-header">
|
||||
<label> Particle Explorer </label>
|
||||
</div>
|
||||
<!-- This will be filled by the script! -->
|
||||
|
|
|
@ -5,6 +5,7 @@
|
|||
// Copyright 2017 High Fidelity, Inc.
|
||||
//
|
||||
// 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.
|
||||
// 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 () {
|
||||
|
||||
var root = document.getElementById("particle-explorer");
|
||||
var root = document.getElementById("properties-list");
|
||||
|
||||
window.onload = function () {
|
||||
var ui = new HifiEntityUI(root);
|
||||
|
@ -51,6 +52,7 @@
|
|||
}
|
||||
};
|
||||
textarea.oninput = textarea.onchange;
|
||||
document.getElementById("show-properties-button").value = "Hide Properties";
|
||||
} else {
|
||||
textarea.onchange = function () {};
|
||||
textarea.oninput = textarea.onchange;
|
||||
|
@ -60,6 +62,7 @@
|
|||
insertZone.parentNode.clientHeight + "px";
|
||||
document.getElementById("export-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