From 16b48046c64c60466f116d5d8976b7df34db2321 Mon Sep 17 00:00:00 2001 From: Ryan Huffman Date: Mon, 11 Feb 2019 15:27:30 -0800 Subject: [PATCH] Fix not being able to type text into particle url field --- scripts/system/html/js/entityProperties.js | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/scripts/system/html/js/entityProperties.js b/scripts/system/html/js/entityProperties.js index ee95312fa4..14a0031f1f 100644 --- a/scripts/system/html/js/entityProperties.js +++ b/scripts/system/html/js/entityProperties.js @@ -2328,7 +2328,7 @@ function createTextureProperty(property, elProperty) { elInput.setAttribute("id", elementID); elInput.setAttribute("type", "text"); - let imageLoad = _.debounce(function (url) { + let imageLoad = function(url) { if (url.slice(0, 5).toLowerCase() === "atp:/") { elImage.src = ""; elImage.style.display = "none"; @@ -2348,15 +2348,12 @@ function createTextureProperty(property, elProperty) { elDiv.classList.remove("no-preview"); 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(elDiv);