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
102
102
*/
103
103
private function prepareForJsLazyLoad ($ block , string $ html ): string
104
104
{
105
+ $ lazyAttribute = ' data-original= ' ;
106
+
105
107
$ pixelSrc = ' src=" ' . $ block ->getViewFileUrl ('Magefan_LazyLoad::images/pixel.jpg ' ) . '" ' ;
106
108
$ tmpSrc = 'TMP_SRC ' ;
109
+ $ tmpDataOriginal = 'TMP_DATA_ORIGINAL ' ;
107
110
108
111
$ html = str_replace ($ pixelSrc , $ tmpSrc , $ html );
112
+ $ html = str_replace ($ lazyAttribute , $ tmpDataOriginal , $ html );
109
113
110
114
$ noscript = '' ;
111
115
if ($ this ->config ->isNoScriptEnabled ()) {
@@ -120,9 +124,10 @@ private function prepareForJsLazyLoad($block, string $html): string
120
124
$ html
121
125
);
122
126
123
- $ html = str_replace (' data-original= ' , $ pixelSrc . ' data-original= ' , $ html );
127
+ $ html = str_replace ($ lazyAttribute , $ pixelSrc . $ lazyAttribute , $ html );
124
128
125
129
$ html = str_replace ($ tmpSrc , $ pixelSrc , $ html );
130
+ $ html = str_replace ($ tmpDataOriginal , $ lazyAttribute , $ html );
126
131
$ html = str_replace (self ::LAZY_TAG , '' , $ html );
127
132
128
133
/* Disable Owl Slider LazyLoad */
You can’t perform that action at this time.
0 commit comments