Skip to content

Commit

Permalink
fix(Incito): Load lazy element backgrounds (#195)
Browse files Browse the repository at this point in the history
Fixes #194
  • Loading branch information
klarstrup committed Apr 24, 2023
1 parent 28faa14 commit 441917b
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions lib/incito-browser/incito.ts
Original file line number Diff line number Diff line change
Expand Up @@ -854,11 +854,12 @@ export default class Incito extends MicroEvent<{
.catch(() => {
el.innerHTML = this.renderHtml({});
});
} else if (el.dataset.bg) {
el.style.backgroundImage = `url(${el.dataset.bg})`;
} else if (el.dataset.src) {
el.src = el.dataset.src;
}
if (el.dataset.bg) {
el.style.backgroundImage = `url(${el.dataset.bg})`;
}
}

triggerSectionVisibility(sectionEl: HTMLElement, visible: boolean) {
Expand Down

0 comments on commit 441917b

Please sign in to comment.