Skip to content

Commit

Permalink
1.5.1, check changelog
Browse files Browse the repository at this point in the history
  • Loading branch information
Rico Kaltofen committed Jan 24, 2019
1 parent 3a39664 commit b707ece
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
@@ -1,6 +1,11 @@
# Changelog
All notable changes to this project will be documented in this file.

## [1.5.1] - 2019-01-24

### Fixed
- lazyload in `picture_lazyload.html5` only set `height` (do not set `width`, otherwise lazyload will break)

## [1.5.0] - 2019-01-24

### Changed
Expand Down
4 changes: 2 additions & 2 deletions src/Resources/contao/templates/picture/picture_lazyload.html5
@@ -1,13 +1,13 @@
<?php $wrapperID = 'image-wrapper-' . mt_rand(); ?>
<div id="<?= $wrapperID; ?>" class="image-wrapper<?php if ($this->class || !empty($this->img['class'])) echo ' '. trim($this->class. ' ' . $this->img['class']); ?>">
<?php $wrapperStyles[] = ('#' . $wrapperID . ':not(.loaded){width: ' . ($this->img['width'] . 'px') . ';height:' . ($this->img['height'] . 'px') . '}'); ?>
<?php $wrapperStyles[] = ('#' . $wrapperID . ':not(.loaded){height:' . ($this->img['height'] . 'px') . '}'); ?>
<?php if ($this->sources): ?>
<picture>
<!--[if IE 9]><video style="display: none;"><![endif]-->
<?php foreach ($this->sources as $source): ?>
<source data-srcset="{{env::url}}/<?= $source['srcset'] ?>"<?php if (!empty($source['sizes'])) echo ' sizes="' . $source['sizes'] . '"'; ?><?php if (!empty($source['media'])) echo ' media="' . $source['media'] . '"'; ?>>
<?php if($source['media']): ?>
<?php $wrapperStyles[] = ('@media ' . $source['media'] . '{#' . $wrapperID . ':not(.loaded){width: ' . ($source['width'] . 'px') . ';height:' . ($source['height'] . 'px') . '}}'); ?>
<?php $wrapperStyles[] = ('@media ' . $source['media'] . '{#' . $wrapperID . ':not(.loaded){height:' . ($source['height'] . 'px') . '}}'); ?>
<?php endif; ?>
<?php endforeach; ?>
<!--[if IE 9]></video><![endif]-->
Expand Down

0 comments on commit b707ece

Please sign in to comment.