Skip to content

Commit

Permalink
Enable magnific popup on <a> tags only when it has <img> (#3114)
Browse files Browse the repository at this point in the history
  • Loading branch information
iBug committed Aug 8, 2021
1 parent 0629bb7 commit ff5b354
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion assets/js/_main.js
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ $(document).ready(function() {
// add lightbox class to all image links
$(
"a[href$='.jpg'],a[href$='.jpeg'],a[href$='.JPG'],a[href$='.png'],a[href$='.gif'],a[href$='.webp']"
).addClass("image-popup");
).has("> img").addClass("image-popup");;

// Magnific-Popup options
$(".image-popup").magnificPopup({
Expand Down
2 changes: 1 addition & 1 deletion assets/js/main.min.js

Large diffs are not rendered by default.

0 comments on commit ff5b354

Please sign in to comment.