mirror of
https://github.com/McShelby/hugo-theme-relearn.git
synced 2025-01-31 08:57:15 +00:00
fix: no wrap images that already wrapped
This commit is contained in:
parent
7df3230957
commit
d67055469d
1 changed files with 3 additions and 1 deletions
|
@ -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);
|
||||||
return "<a href='" + image[0].src + "' data-featherlight='image'></a>";
|
if (!image.parent("a").length) {
|
||||||
|
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
|
||||||
|
|
Loading…
Add table
Reference in a new issue