File tree Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -102,10 +102,14 @@ public function afterToHtml(\Magento\Framework\View\Element\AbstractBlock $block
102102 */
103103 private function prepareForJsLazyLoad ($ block , string $ html ): string
104104 {
105+ $ lazyAttribute = ' data-original= ' ;
106+
105107 $ pixelSrc = ' src=" ' . $ block ->getViewFileUrl ('Magefan_LazyLoad::images/pixel.jpg ' ) . '" ' ;
106108 $ tmpSrc = 'TMP_SRC ' ;
109+ $ tmpDataOriginal = 'TMP_DATA_ORIGINAL ' ;
107110
108111 $ html = str_replace ($ pixelSrc , $ tmpSrc , $ html );
112+ $ html = str_replace ($ lazyAttribute , $ tmpDataOriginal , $ html );
109113
110114 $ noscript = '' ;
111115 if ($ this ->config ->isNoScriptEnabled ()) {
@@ -120,9 +124,10 @@ private function prepareForJsLazyLoad($block, string $html): string
120124 $ html
121125 );
122126
123- $ html = str_replace (' data-original= ' , $ pixelSrc . ' data-original= ' , $ html );
127+ $ html = str_replace ($ lazyAttribute , $ pixelSrc . $ lazyAttribute , $ html );
124128
125129 $ html = str_replace ($ tmpSrc , $ pixelSrc , $ html );
130+ $ html = str_replace ($ tmpDataOriginal , $ lazyAttribute , $ html );
126131 $ html = str_replace (self ::LAZY_TAG , '' , $ html );
127132
128133 /* Disable Owl Slider LazyLoad */
You can’t perform that action at this time.
0 commit comments