Skip to content

Commit

Permalink
fix: added seperate function to trigger on load for img and video to …
Browse files Browse the repository at this point in the history
…remove title
  • Loading branch information
srijitcoder committed Jan 17, 2025
1 parent 392aaa7 commit e78cdde
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion elements/storytelling/src/helpers/render-html-string.js
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ function processNode(node, initDispatchFunc) {
}
};

media.onload = () => {
const loadFunc = () => {
if (
document.body.contains(media) &&
media.title.includes("temp-backup-url=")
Expand All @@ -216,6 +216,9 @@ function processNode(node, initDispatchFunc) {
}
};

media.onload = loadFunc;
media.onloadeddata = loadFunc;

lightboxElements.push({
type: "image",
href: media.src,
Expand Down

0 comments on commit e78cdde

Please sign in to comment.