diff --git a/resources/www/common/js/jquery.tooltip.js b/resources/www/common/js/jquery.tooltip.js index 6822568f64..91bc252ecf 100644 --- a/resources/www/common/js/jquery.tooltip.js +++ b/resources/www/common/js/jquery.tooltip.js @@ -348,7 +348,7 @@ //correction par ratio - if (resizeImgTips && $('#' + settings($.tooltip.current).id + ' .imgTips')[0]) { + if (resizeImgTips && $imgTips.get(0)) { if (ratioSurfaceH > ratioImage) { horS = v.y * ratioImage * v.y; @@ -416,13 +416,12 @@ top: top }); - //si ya une image on re-ajuste au ratio - if (resizeImgTips && $('#' + settings($.tooltip.current).id + ' .imgTips')[0]) { + if (resizeImgTips && $imgTips.get(0)) { if (width == 'auto') - width = $('#' + settings($.tooltip.current).id).width(); + width = $imgTips.get(0).width(); if (height == 'auto') - height = $('#' + settings($.tooltip.current).id).height(); + height = $imgTips.get(0).height(); if (ratio > 1) { var nh = width / ratio; if (nh > height) { @@ -439,7 +438,19 @@ } width = nw; } - } else { + } + else if (resizeVideoTips && $videoTips.get(0)) { + width = $videoTips.data('original-width'); + height = $videoTips.data('original-height'); + // limit video to maxWidth: + if( width > 720 ) { + var limitRatio = width/height; + width = 720; + height = width / limitRatio; + } + console.log('video first scaled to ', width, height) + } + else { if (vertS < horS) { height = 'auto'; } @@ -469,7 +480,7 @@ width = imgWidth + 45; height = imgHeight + 75; - + console.log('video scaled to ', width, height) $videoTips.css({ width: Math.round(imgWidth), height: Math.round(imgHeight) diff --git a/resources/www/prod/styles/main.scss b/resources/www/prod/styles/main.scss index 666b3ffd16..74ad3a7830 100644 --- a/resources/www/prod/styles/main.scss +++ b/resources/www/prod/styles/main.scss @@ -23,13 +23,7 @@ overflow-y: auto; } -.caption-tooltip-container { - max-width: 500px; - -} .caption-tooltip-container .popover-inner .popover-content { - max-width: 500px; - max-height: 500px; overflow: auto; overflow-x: hidden; } diff --git a/templates/web/common/thumbnail.html.twig b/templates/web/common/thumbnail.html.twig index a76e82aac5..5389e509c1 100644 --- a/templates/web/common/thumbnail.html.twig +++ b/templates/web/common/thumbnail.html.twig @@ -10,7 +10,7 @@ {% endif %} {% if record_type == 'VIDEO_MP4' or record_type == 'VIDEO_FLV' %} -