added javascript to set the events header text height equal to the largest one for...
authorAnthony Talarico <talarico@gaslightmedia.com>
Fri, 29 Jul 2016 18:52:08 +0000 (14:52 -0400)
committerAnthony Talarico <talarico@gaslightmedia.com>
Fri, 29 Jul 2016 18:52:08 +0000 (14:52 -0400)
js/app.js
js/custom/pageSetup.js

index da0f2b9..68f480c 100644 (file)
--- a/js/app.js
+++ b/js/app.js
@@ -104,8 +104,26 @@ $(document).ready(function () {
     event_feed.addClass("feed");
     event_feed.children("div").addClass("feed-block");
     
-
+    Array.max = function( array ){
+        return Math.max.apply( Math, array );
+    };
+    
+    var event_header_heights = [];
+    $(event_feed).find('div').each( function () {
+         var event_header = $(this).find('h6');
+         event_header_heights.push(event_header.height());
+    });
+    
+    var header_height_max = Array.max(event_header_heights);
+    
+     // replace the event's img element with a wrapper div that has a background image of the same src
      $(event_feed).find("div").each( function () {
+        var event_header = $(this).find('h6');
+        var prev = $(this).prev();
+        var next = $(this).next();
+         
+         event_header.css("height", header_height_max + "px");
+
         var img_src = $(this).find("img").attr('src');
         $(this).find('img').wrap("<div style='background: url(" + img_src + ") no-repeat center center;background-size: cover;' class='image-container'></div>");
         $(this).find('img').remove();
index 11cd467..7097818 100644 (file)
@@ -95,8 +95,26 @@ $(document).ready(function () {
     event_feed.addClass("feed");
     event_feed.children("div").addClass("feed-block");
     
-
+    Array.max = function( array ){
+        return Math.max.apply( Math, array );
+    };
+    
+    var event_header_heights = [];
+    $(event_feed).find('div').each( function () {
+         var event_header = $(this).find('h6');
+         event_header_heights.push(event_header.height());
+    });
+    
+    var header_height_max = Array.max(event_header_heights);
+    
+     // replace the event's img element with a wrapper div that has a background image of the same src
      $(event_feed).find("div").each( function () {
+        var event_header = $(this).find('h6');
+        var prev = $(this).prev();
+        var next = $(this).next();
+         
+         event_header.css("height", header_height_max + "px");
+
         var img_src = $(this).find("img").attr('src');
         $(this).find('img').wrap("<div style='background: url(" + img_src + ") no-repeat center center;background-size: cover;' class='image-container'></div>");
         $(this).find('img').remove();