Skip to content

Commit

Permalink
Docs upd: custom-content.md (#2024)
Browse files Browse the repository at this point in the history
Fix event names to use the WebP format
  • Loading branch information
thomasnavarro authored Mar 29, 2023
1 parent d3482fe commit f481b64
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions docs/custom-content.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ lightbox.addFilter('itemData', (itemData, index) => {
});

// use <picture> instead of <img>
lightbox.on('contentLoadImage', (e) => {
lightbox.on('contentLoad', (e) => {
const { content, isLazy } = e;

if (content.data.webpSrc) {
Expand Down Expand Up @@ -79,7 +79,7 @@ lightbox.on('contentLoadImage', (e) => {

// by default PhotoSwipe appends <img>,
// but we want to append <picture>
lightbox.on('contentAppendImage', (e) => {
lightbox.on('contentAppend', (e) => {
const { content } = e;
if (content.pictureElement && !content.pictureElement.parentNode) {
e.preventDefault();
Expand Down

0 comments on commit f481b64

Please sign in to comment.