fix(site): image load error handler
This commit is contained in:
parent
7300250bff
commit
a78925d285
|
@ -215,8 +215,10 @@ if (isset($_GET['random'])) {
|
||||||
|
|
||||||
// if imgproxy version fails to load, fallback to full-size image
|
// if imgproxy version fails to load, fallback to full-size image
|
||||||
document.querySelectorAll(".gallery img").forEach(function(img) {
|
document.querySelectorAll(".gallery img").forEach(function(img) {
|
||||||
|
img.addEventListener("error", function() {
|
||||||
this.src = this.parentElement.href;
|
this.src = this.parentElement.href;
|
||||||
});
|
});
|
||||||
|
});
|
||||||
</script>
|
</script>
|
||||||
</body>
|
</body>
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue