Skip to content
This repository has been archived by the owner on Feb 13, 2022. It is now read-only.

Commit

Permalink
🐛 closes #14
Browse files Browse the repository at this point in the history
Signed-off-by: Bruno Meilick <[email protected]>
  • Loading branch information
bnomei committed Oct 30, 2019
1 parent aeafd2a commit d2742b0
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "bnomei/kirby3-srcset",
"type": "kirby-plugin",
"version": "3.1.1",
"version": "3.1.2",
"license": "MIT",
"description": "Kirby 3 Plugin for creating lazyloading image srcset",
"authors": [
Expand Down
6 changes: 6 additions & 0 deletions index.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@
],
'fileMethods' => [
'lazysrcset' => function ($options = null) {
if ($this === null) {
return \Kirby\Cms\Html::img('', ['alt' => 'lazysrcset can not create srcset from null']);
}
if (is_string($options)) {
$options = ['srcset' => $options];
}
Expand All @@ -29,6 +32,9 @@
\Bnomei\Srcset::kirbytagAttrs()
),
'html' => function ($tag) {
if ($tag === null) {
return \Kirby\Cms\Html::img('', ['alt' => 'lazysrcset can not create srcset from null']);
}
$srcsetTag = new \Bnomei\Srcset($tag);
return $srcsetTag->html();
},
Expand Down

0 comments on commit d2742b0

Please sign in to comment.