|
@@ -157,22 +157,22 @@ |
|
|
block discarded – undo |
|
157
|
157
|
public function run() |
|
158
|
158
|
{ |
|
159
|
159
|
if ($this->placeholderSrc && $this->placeholderAsBase64) { |
|
160
|
|
- $this->placeholderSrc = 'data:image/jpg;base64,' . base64_encode(file_get_contents($this->placeholderSrc)); |
|
|
160
|
+ $this->placeholderSrc = 'data:image/jpg;base64,'.base64_encode(file_get_contents($this->placeholderSrc)); |
|
161
|
161
|
} |
|
162
|
162
|
|
|
163
|
163
|
if ($this->attributesOnly && !$this->placeholderSrc) { |
|
164
|
164
|
return "class=\"js-lazyimage {$this->extraClass}\" data-src=\"$this->src\" data-width=\"$this->width\" data-height=\"$this->height\" data-as-background=\"1\""; |
|
165
|
165
|
} |
|
166
|
166
|
|
|
167
|
|
- $tag = '<div class="lazyimage-wrapper ' . $this->extraClass . '">'; |
|
|
167
|
+ $tag = '<div class="lazyimage-wrapper '.$this->extraClass.'">'; |
|
168
|
168
|
$tag .= Html::tag('img', '', array_merge($this->options, ['class' => 'js-lazyimage lazyimage', 'data-src' => $this->src, 'data-width' => $this->width, 'data-height' => $this->height])); |
|
169
|
169
|
if ($this->placeholderSrc) { |
|
170
|
170
|
$tag .= Html::tag('img', '', ['class' => 'lazyimage-placeholder', 'src' => $this->placeholderSrc]); |
|
171
|
171
|
} else { |
|
172
|
172
|
$aspectRatio = ($this->height && $this->width) ? (($this->height / $this->width) * 100) : 56.25; |
|
173
|
|
- $tag .= '<div class="lazyimage-placeholder"><div style="display: block; height: 0px; padding-bottom: ' . $aspectRatio . '%;"></div><div class="loader"></div></div>'; |
|
|
173
|
+ $tag .= '<div class="lazyimage-placeholder"><div style="display: block; height: 0px; padding-bottom: '.$aspectRatio.'%;"></div><div class="loader"></div></div>'; |
|
174
|
174
|
} |
|
175
|
|
- $tag .= '<noscript><img class="lazyimage loaded ' . $this->extraClass . '" src="'.$this->src.'" /></noscript>'; |
|
|
175
|
+ $tag .= '<noscript><img class="lazyimage loaded '.$this->extraClass.'" src="'.$this->src.'" /></noscript>'; |
|
176
|
176
|
$tag .= '</div>'; |
|
177
|
177
|
|
|
178
|
178
|
return $tag; |
Please login to merge, or discard this patch.