fix: no wrap images that already wrapped

This commit is contained in:
Alex Vargas Benamburg 2018-01-22 23:33:14 -06:00
parent 7df3230957
commit d67055469d

View file

@ -21,7 +21,9 @@ var images = $("div#body-inner img").not(".inline");
// Wrap image inside a featherlight (to get a full size view in a popup) // Wrap image inside a featherlight (to get a full size view in a popup)
images.wrap(function(){ images.wrap(function(){
var image =$(this); var image =$(this);
if (!image.parent("a").length) {
return "<a href='" + image[0].src + "' data-featherlight='image'></a>"; return "<a href='" + image[0].src + "' data-featherlight='image'></a>";
}
}); });
// Change styles, depending on parameters set to the image // Change styles, depending on parameters set to the image