Skip to content

Commit 94f094d

Browse files
committed
Fix for page builder bg images lazy load
1 parent 98d4c21 commit 94f094d

File tree

2 files changed

+14
-1
lines changed

2 files changed

+14
-1
lines changed

Plugin/BlockPlugin.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,13 @@ public function afterToHtml(\Magento\Framework\View\Element\AbstractBlock $block
9696
$html
9797
);
9898

99+
/* Fix for page builder bg images */
100+
if (false !== strpos($html, 'background-image-')) {
101+
$html = str_replace('.background-image-', '.tmpbgimg-', $html);
102+
$html = str_replace('background-image-', 'mflazy-background-image mflazy-background-image-', $html);
103+
$html = str_replace('.tmpbgimg-', '.background-image-', $html);
104+
}
105+
99106
return $html;
100107
}
101108

view/frontend/web/js/lazyload.min.js

Lines changed: 7 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)