diff options
| author | horus | 2020-09-19 02:13:24 +0200 |
|---|---|---|
| committer | horus | 2020-09-19 02:13:24 +0200 |
| commit | b57bab1cf2e3e7d9b965bade697f209d8957080a (patch) | |
| tree | 58aa6bf9726945617178aaca6fffe929f6ec3704 /public | |
| parent | 8e6c5c4b8f59e9874aa99bb5db5de8f521de0ab3 (diff) | |
| download | senpai-b57bab1cf2e3e7d9b965bade697f209d8957080a.tar.gz | |
dynamically update img src when camo proxy fails
Diffstat (limited to 'public')
| -rw-r--r-- | public/js/app.js | 8 |
1 files changed, 8 insertions, 0 deletions
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": |
