Skip to content

Commit

Permalink
🐛 Better handling of figcaption
Browse files Browse the repository at this point in the history
  • Loading branch information
jonnitto committed Sep 11, 2018
1 parent 2ca0fdc commit df0b0ec
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
6 changes: 5 additions & 1 deletion Resources/Private/Assets/Main.js
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,11 @@ neosPhotoSwipe.init = function(selector) {
}
}

figcaption = element.parentNode.querySelector("figcaption");
var figure = closest(element, function(el) {
return el.tagName && el.tagName.toLowerCase() === 'figure';
});

figcaption = figure ? figure.querySelector("figcaption") : element.querySelector("figcaption");
figcaption = figcaption ? figcaption.innerHTML || false : false;
image = element.querySelector("img");

Expand Down
Loading

0 comments on commit df0b0ec

Please sign in to comment.