Przeglądaj źródła

#3723 - Timeline: don't cut image by "See more" element

RomanL 4 lat temu
rodzic
commit
9ef3bf3eaa
1 zmienionych plików z 7 dodań i 0 usunięć
  1. 7 0
      modules/boonex/timeline/js/main.js

+ 7 - 0
modules/boonex/timeline/js/main.js

@@ -427,6 +427,13 @@ BxTimelineMain.prototype._getPost = function(oView, iId, aParams) {
             var oElement = $(this);
             if(oElement.hasClass(sClass) || oElement.css('overflow') != 'hidden')
             	return;
+            
+            if (oElement.find('img').length > 0){
+                var iRelImgY = oElement.find('img').first().offset().top - oElement.offset().top;
+                if (iRelImgY < oElement.height() && iRelImgY + oElement.find('img').first().height() > oElement.height()){
+                    oElement.css('max-height', (iRelImgY + oElement.find('img').first().height()) +  50 + 'px');
+                }
+            }
 
             if(oElement.prop('scrollHeight') <= oElement.height())
             	return;