diff options
Diffstat (limited to 'resources/js')
| -rw-r--r-- | resources/js/app.js | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/resources/js/app.js b/resources/js/app.js index 40c55f6..37e0fdb 100644 --- a/resources/js/app.js +++ b/resources/js/app.js @@ -1 +1,8 @@ require('./bootstrap'); + +$(".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 +}); |
