|
|
@@ -1011,15 +1011,13 @@ function bx_time(sLang, isAutoupdate, sRootSel) {
|
|
|
if(oElement.hasClass(sClass) || oElement.css('overflow') != 'hidden')
|
|
|
return;
|
|
|
|
|
|
- if(oElement.find('img').length > 0){
|
|
|
- var oImg = oElement.find('img').first();
|
|
|
- var iRelImgY = oImg.offset().top - oElement.offset().top;
|
|
|
-
|
|
|
- const img = new Image();
|
|
|
- img.src = oImg.prop('src');
|
|
|
- img.onload = function() {
|
|
|
- if(iRelImgY < oElement.height() && iRelImgY + this.height > oElement.height())
|
|
|
- oElement.css('max-height', (iRelImgY + this.height) + 50 + 'px');
|
|
|
+ if(oElement.find('img').length > 0) {
|
|
|
+ oElement.find('img:first').get(0).onload = function() {
|
|
|
+ var iHeightParent = oElement.height();
|
|
|
+ var iHeightImg = this.clientHeight;
|
|
|
+ var iOffsetTopImg = this.offsetTop;
|
|
|
+ if(iOffsetTopImg < iHeightParent && iOffsetTopImg + iHeightImg > iHeightParent)
|
|
|
+ oElement.css('max-height', (iOffsetTopImg + iHeightImg + 50) + 'px');
|
|
|
|
|
|
if(oElement.prop('scrollHeight') <= Math.ceil(oElement.height()))
|
|
|
return;
|