mirror of
https://github.com/overte-org/overte.git
synced 2025-08-09 13:28:09 +02:00
Make sure max constraints reset
This now occurs when selecting a new entity and having the UI filled again
This commit is contained in:
parent
32982326b1
commit
903762b122
1 changed files with 15 additions and 4 deletions
|
@ -151,7 +151,7 @@ HifiEntityUI.prototype = {
|
||||||
json[key] = document.getElementById(key).value;
|
json[key] = document.getElementById(key).value;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
return json;
|
return json;
|
||||||
},
|
},
|
||||||
|
@ -159,12 +159,18 @@ HifiEntityUI.prototype = {
|
||||||
var self = this;
|
var self = this;
|
||||||
var fields = document.getElementsByTagName("input");
|
var fields = document.getElementsByTagName("input");
|
||||||
|
|
||||||
|
console.log("Locking Settings Update while filling input Fields.");
|
||||||
self.settingsUpdateLock = true;
|
self.settingsUpdateLock = true;
|
||||||
if (!currentProperties.locked) {
|
if (!currentProperties.locked) {
|
||||||
for (var i = 0; i < fields.length; i++) {
|
for (var i = 0; i < fields.length; i++) {
|
||||||
fields[i].removeAttribute("disabled");
|
fields[i].removeAttribute("disabled");
|
||||||
|
if (fields[i].hasAttribute("data-max")) {
|
||||||
|
// Reset Max to original max
|
||||||
|
fields[i].setAttribute("max", fields[i].getAttribute("data-max"));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (self.onSelect) {
|
if (self.onSelect) {
|
||||||
self.onSelect();
|
self.onSelect();
|
||||||
}
|
}
|
||||||
|
@ -230,8 +236,11 @@ HifiEntityUI.prototype = {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
// Now unlocking settings Update lock for sending messages on callbacks.
|
||||||
self.settingsUpdateLock = false;
|
setTimeout(function () {
|
||||||
|
console.log("Unlocking UI");
|
||||||
|
self.settingsUpdateLock = false;
|
||||||
|
}, 50);
|
||||||
},
|
},
|
||||||
connect: function (EventBridge) {
|
connect: function (EventBridge) {
|
||||||
this.EventBridge = EventBridge;
|
this.EventBridge = EventBridge;
|
||||||
|
@ -297,7 +306,7 @@ HifiEntityUI.prototype = {
|
||||||
title.innerHTML = section;
|
title.innerHTML = section;
|
||||||
title.appendChild(dropDown);
|
title.appendChild(dropDown);
|
||||||
sectionDivHeader.appendChild(title);
|
sectionDivHeader.appendChild(title);
|
||||||
|
|
||||||
var collapsed = index !== 0;
|
var collapsed = index !== 0;
|
||||||
|
|
||||||
dropDown.innerHTML = collapsed ? "L" : "M";
|
dropDown.innerHTML = collapsed ? "L" : "M";
|
||||||
|
@ -565,6 +574,7 @@ HifiEntityUI.prototype = {
|
||||||
|
|
||||||
slider.setAttribute("min", group.min !== undefined ? group.min : 0);
|
slider.setAttribute("min", group.min !== undefined ? group.min : 0);
|
||||||
slider.setAttribute("max", group.max !== undefined ? group.max : 10000);
|
slider.setAttribute("max", group.max !== undefined ? group.max : 10000);
|
||||||
|
slider.setAttribute("data-max", group.max !== undefined ? group.max : 10000);
|
||||||
slider.setAttribute("step", 1);
|
slider.setAttribute("step", 1);
|
||||||
|
|
||||||
inputField.oninput = function (event) {
|
inputField.oninput = function (event) {
|
||||||
|
@ -620,6 +630,7 @@ HifiEntityUI.prototype = {
|
||||||
|
|
||||||
slider.setAttribute("min", group.min !== undefined ? group.min : 0);
|
slider.setAttribute("min", group.min !== undefined ? group.min : 0);
|
||||||
slider.setAttribute("max", group.max !== undefined ? group.max : 1);
|
slider.setAttribute("max", group.max !== undefined ? group.max : 1);
|
||||||
|
slider.setAttribute("data-max", group.max !== undefined ? group.max : 1);
|
||||||
slider.setAttribute("step", 0.01);
|
slider.setAttribute("step", 0.01);
|
||||||
|
|
||||||
inputField.oninput = function (event) {
|
inputField.oninput = function (event) {
|
||||||
|
|
Loading…
Reference in a new issue