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