]> git.parisson.com Git - mezzo.git/commitdiff
Fix caption height on page sliders
authorJérémy Fabre <Jeremy@iMac-de-Jeremy.local>
Mon, 24 Oct 2016 09:12:31 +0000 (11:12 +0200)
committerJérémy Fabre <Jeremy@iMac-de-Jeremy.local>
Mon, 24 Oct 2016 09:12:31 +0000 (11:12 +0200)
app/static/src/js/modules/lightsliderpage-init.js
app/static/src/sass/modules/sliders/_slider-page.scss

index 9ed84de523458168a05cdd4ca882ca5eb24b7747..0221d471c2f9e126550f225e38c46a9ad3db604f 100644 (file)
@@ -39,6 +39,20 @@ LightSliderPageInit.prototype.init = function() {
                     $(el).find('video').each(function(i) {
                         this.pause();
                     });
+                },
+                onSliderLoad: function (el) {
+
+                    var maxHeight = 0,
+                    container = $(el),
+                    children = container.children();
+
+                    children.each(function () {
+                        var childHeight = $(this).height();
+                        if (childHeight > maxHeight) {
+                            maxHeight = childHeight;
+                        }
+                    });
+                    container.height(maxHeight);
                 }
             }
         };
index 1f58dbe464c4f7b3eeb9aca55c93b5f388e5b411..451fcb808b8caed83967c5731daf091d1ff42148 100644 (file)
@@ -5,7 +5,7 @@ $module: ".slider-page";
     list-style-type: none;
     margin: 0;
     padding: 0;
-    
+
 
     //
     // Not lightslider, lets go with Flexbox W00t W00t