Skip to content

Commit

Permalink
fix undefined resetImgSrc inside error handler due to jquery rewritin…
Browse files Browse the repository at this point in the history
…g what `this` is
  • Loading branch information
ericnewton76 committed Apr 8, 2022
1 parent c8ef4d2 commit c855b1b
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/js/justifiedGallery.js
Original file line number Diff line number Diff line change
Expand Up @@ -192,8 +192,9 @@ JustifiedGallery.prototype.displayEntry = function ($entry, x, y, imgWidth, imgH
if (imageSrc) {
imageSrc = this.newSrc(imageSrc, imgWidth, imgHeight, $image[0]);

var self = this;
$image.one('error', function () {
this.resetImgSrc($image); //revert to the original thumbnail
self.resetImgSrc($image); //revert to the original thumbnail
});

var loadNewImage = function () {
Expand Down

0 comments on commit c855b1b

Please # to comment.