Browse code

Apply the latest image related settings to the slider envelope element also

Benjamin Roth authored on07/05/2018 13:05:33
Showing1 changed files
... ...
@@ -54,6 +54,15 @@ class ContentSlickSliderStart extends \ContentElement
54 54
         $this->singleSRC = $objFile->path;
55 55
 
56 56
         $this->addImageToTemplate($this->Template, array('singleSRC'=>$this->singleSRC, 'size'=>$this->size));
57
+
58
+        if ($this->eSM_slick_minHeight) {
59
+          if ($this->eSM_slick_bgSize && $this->eSM_slick_bgSize == 'auto auto') {
60
+            $this->Template->minHeight = $this->Template->picture['img']['height'] . 'px';
61
+          } else
62
+          {
63
+            $this->Template->minHeight = round($this->Template->picture['img']['height'] / $this->Template->picture['img']['width'] * 100) . '%';
64
+          }
65
+        }
57 66
       }
58 67
 
59 68
       $backgroundStyle = 'background-image: url(\''.$this->Template->src.'\');';
... ...
@@ -71,9 +80,8 @@ class ContentSlickSliderStart extends \ContentElement
71 80
       if ($this->eSM_slick_bgOpacity) {
72 81
         $backgroundStyle .= 'opacity:' . $this->eSM_slick_bgOpacity/100 . ';';
73 82
       }
74
-
75
-      if ($this->eSM_slick_minHeight) {
76
-        $this->Template->minHeight = round($this->Template->height/$this->Template->width*100).'%';
83
+      if ($this->eSM_slick_bgRepeat) {
84
+        $backgroundStyle .= 'background-repeat: ' . $this->eSM_slick_bgRepeat . ';';
77 85
       }
78 86
 
79 87
       $this->Template->backgroundStyle = $backgroundStyle;