mirror of
https://github.com/overte-org/overte.git
synced 2025-08-09 05:58:27 +02:00
Fix not being able to type text into particle url field
This commit is contained in:
parent
8faff57033
commit
16b48046c6
1 changed files with 6 additions and 9 deletions
|
@ -2328,7 +2328,7 @@ function createTextureProperty(property, elProperty) {
|
||||||
elInput.setAttribute("id", elementID);
|
elInput.setAttribute("id", elementID);
|
||||||
elInput.setAttribute("type", "text");
|
elInput.setAttribute("type", "text");
|
||||||
|
|
||||||
let imageLoad = _.debounce(function (url) {
|
let imageLoad = function(url) {
|
||||||
if (url.slice(0, 5).toLowerCase() === "atp:/") {
|
if (url.slice(0, 5).toLowerCase() === "atp:/") {
|
||||||
elImage.src = "";
|
elImage.src = "";
|
||||||
elImage.style.display = "none";
|
elImage.style.display = "none";
|
||||||
|
@ -2348,15 +2348,12 @@ function createTextureProperty(property, elProperty) {
|
||||||
elDiv.classList.remove("no-preview");
|
elDiv.classList.remove("no-preview");
|
||||||
elDiv.classList.add("no-texture");
|
elDiv.classList.add("no-texture");
|
||||||
}
|
}
|
||||||
}, IMAGE_DEBOUNCE_TIMEOUT);
|
|
||||||
elInput.imageLoad = imageLoad;
|
|
||||||
elInput.oninput = function (event) {
|
|
||||||
// Add throttle
|
|
||||||
let url = event.target.value;
|
|
||||||
imageLoad(url);
|
|
||||||
updateProperty(property.name, url, property.isParticleProperty)
|
|
||||||
};
|
};
|
||||||
elInput.onchange = elInput.oninput;
|
elInput.imageLoad = imageLoad;
|
||||||
|
elInput.addEventListener('change', createEmitTextPropertyUpdateFunction(property));
|
||||||
|
elInput.addEventListener('change', function(ev) {
|
||||||
|
imageLoad(ev.target.value);
|
||||||
|
});
|
||||||
|
|
||||||
elProperty.appendChild(elInput);
|
elProperty.appendChild(elInput);
|
||||||
elProperty.appendChild(elDiv);
|
elProperty.appendChild(elDiv);
|
||||||
|
|
Loading…
Reference in a new issue