aboutsummaryrefslogtreecommitdiff
path: root/webAO/dom/imgError.ts
blob: dfc6c9282e84cf1c43f8a9b3466dc79c596d365a (plain)
1
2
3
4
5
6
7
8
9
10
/**
 * Triggered when there was an error loading a generic sprite.
 * @param {HTMLImageElement} image the element containing the missing image
 */
export function imgError(image: HTMLImageElement) {
  image.onerror = null;
  image.src = ""; // unload so the old sprite doesn't persist
  return true;
}
window.imgError = imgError;