Skip to content

Commit

Permalink
Reduce srcset for images in the panel
Browse files Browse the repository at this point in the history
  • Loading branch information
bastianallgeier committed Jun 13, 2019
1 parent 0db632a commit dd5832b
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 19 deletions.
2 changes: 1 addition & 1 deletion panel/dist/css/app.css

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion panel/dist/js/app.js

Large diffs are not rendered by default.

18 changes: 1 addition & 17 deletions src/Cms/ModelWithContent.php
Expand Up @@ -317,25 +317,14 @@ public function panelImage($settings = null): ?array
'url' => 'data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw',
'srcset' => $image->srcset([
352,
432,
704,
864,
944,
1056,
1408,
1888,
2112,
2816
])
];

// for lists
$settings['list'] = [
'url' => $image->thumb([
'width' => 38,
'height' => 38,
'crop' => 'center'
])->url(true),
'url' => 'data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw',
'srcset' => $image->srcset([
'1x' => [
'width' => 38,
Expand All @@ -347,11 +336,6 @@ public function panelImage($settings = null): ?array
'height' => 76,
'crop' => 'center'
],
'3x' => [
'width' => 152,
'height' => 152,
'crop' => 'center'
]
])
];

Expand Down

0 comments on commit dd5832b

Please sign in to comment.