Enable magnific popup on <a> tags only when it has <img> (#3114)

This commit is contained in:
iBug 2021-08-09 02:01:59 +08:00 committed by GitHub
parent 0629bb770d
commit ff5b354a9a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View file

@ -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({

File diff suppressed because one or more lines are too long