Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/matcornic/hugo-theme-learn.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/static
diff options
context:
space:
mode:
authorAlex Vargas Benamburg <vb.alexr@gmail.com>2018-01-23 08:33:14 +0300
committerAlex Vargas Benamburg <vb.alexr@gmail.com>2018-01-23 08:33:14 +0300
commitd67055469de0093472d897276def47e6d97bac2a (patch)
tree3e23cc5cef861274770f7beba68969f2e952a888 /static
parent7df323095725662af37b178afd0b9f104ef7d742 (diff)
fix: no wrap images that already wrapped
Diffstat (limited to 'static')
-rw-r--r--static/js/hugo-learn.js4
1 files changed, 3 insertions, 1 deletions
diff --git a/static/js/hugo-learn.js b/static/js/hugo-learn.js
index b20313a..213e31e 100644
--- a/static/js/hugo-learn.js
+++ b/static/js/hugo-learn.js
@@ -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)
images.wrap(function(){
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