From b57bab1cf2e3e7d9b965bade697f209d8957080a Mon Sep 17 00:00:00 2001 From: horus Date: Sat, 19 Sep 2020 02:13:24 +0200 Subject: dynamically update img src when camo proxy fails --- public/js/app.js | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'public') diff --git a/public/js/app.js b/public/js/app.js index 58609e7..99c1139 100644 --- a/public/js/app.js +++ b/public/js/app.js @@ -37073,6 +37073,14 @@ module.exports = function(module) { __webpack_require__(/*! ./bootstrap */ "./resources/js/bootstrap.js"); +$(".mal-img").not(".mal-img-error").on("error", function () { + if (!$(this).hasClass("mal-img-error")) { + this.src = $(this).data("img-src"); + } + + $(this).addClass('mal-img-error'); // prevents loops +}); + /***/ }), /***/ "./resources/js/bootstrap.js": -- cgit v1.2.3