Display "no preview available" for ATP images in particles UI

This commit is contained in:
David Rowe 2017-11-10 10:23:35 +13:00
parent 2c542b73a0
commit c53c356842
2 changed files with 15 additions and 2 deletions

View file

@ -482,14 +482,23 @@ HifiEntityUI.prototype = {
textureImage.className = "texture-image no-texture";
var image = document.createElement("img");
var imageLoad = _.debounce(function (url) {
if (url.length > 0) {
if (url.slice(0, 5).toLowerCase() === "atp:/") {
image.src = "";
image.style.display = "none";
textureImage.classList.remove("with-texture");
textureImage.classList.remove("no-texture");
textureImage.classList.add("no-preview");
} else if (url.length > 0) {
textureImage.classList.remove("no-texture");
textureImage.classList.remove("no-preview");
textureImage.classList.add("with-texture");
image.src = url;
image.style.display = "block";
} else {
image.src = "";
image.style.display = "none";
textureImage.classList.remove("with-texture");
textureImage.classList.remove("no-preview");
textureImage.classList.add("no-texture");
}
self.webBridgeSync(group.id, url);

File diff suppressed because one or more lines are too long