Skip to content
Code-Schnipsel Gruppen Projekte
Commit dd56aaf5 erstellt von Michael Danielczok's avatar Michael Danielczok
Dateien durchsuchen

feat: New attribute for promoslider: image size, to control speed up of page load.

Übergeordneter d810aff9
No related branches found
No related tags found
Keine zugehörigen Merge Requests gefunden
......@@ -29,7 +29,7 @@
>&nbsp;</div>
{elseif $slide.image}
<div class="quiqqer-bricks-promoslider-slide-image">
{image image=$slide.image}
{image image=$slide.image width=$imageSize}
</div>
{/if}
......@@ -78,7 +78,7 @@
>&nbsp;</div>
{elseif $slide.image}
<div class="quiqqer-bricks-promoslider-slide-mobile-image">
{image image=$slide.image}
{image image=$slide.image width=$imageSize}
</div>
{/if}
......
......@@ -21,10 +21,10 @@ class Promoslider extends AbstractPromoslider
*
* @param array $attributes
*/
public function __construct($attributes = array())
public function __construct($attributes = [])
{
// default options
$this->setAttributes(array(
$this->setAttributes([
'title' => '',
'text' => '',
'class' => 'quiqqer-bricks-promoslider',
......@@ -36,8 +36,9 @@ public function __construct($attributes = array())
'image-wallpaper-attachment' => false,
'autostart' => false,
'delay' => 5000,
'isMobileSlidesEnabled' => false
));
'isMobileSlidesEnabled' => false,
'imageSize' => false // false = use original size, do not create srcset
]);
$this->addCSSFile(
dirname(__FILE__) . '/Promoslider.css'
......@@ -46,7 +47,6 @@ public function __construct($attributes = array())
$this->addCSSClass('grid-100');
$this->addCSSClass('mobile-grid-100');
parent::__construct($attributes);
}
......@@ -169,12 +169,13 @@ public function getBody()
$this->parseSlides($this->getAttribute('desktopslides'), 'desktop');
$options = array(
$options = [
'this' => $this,
'desktopSlides' => $this->desktopSlides,
'Utils' => new Utils()
);
'Utils' => new Utils(),
'imageSize' => $this->getAttribute('imageSize')
];
if ($this->getAttribute('isMobileSlidesEnabled') === "true") {
$this->parseSlides($this->getAttribute('mobileslides'), 'mobile');
......
0% oder .
You are about to add 0 people to the discussion. Proceed with caution.
Bearbeitung dieser Nachricht zuerst beenden!
Bitte registrieren oder zum Kommentieren