fix video tooltips

This commit is contained in:
Florian BLOUET
2016-01-13 17:02:43 +01:00
parent 50ec80af97
commit d7255c489e
3 changed files with 19 additions and 14 deletions

View File

@@ -348,7 +348,7 @@
//correction par ratio //correction par ratio
if (resizeImgTips && $('#' + settings($.tooltip.current).id + ' .imgTips')[0]) { if (resizeImgTips && $imgTips.get(0)) {
if (ratioSurfaceH > ratioImage) { if (ratioSurfaceH > ratioImage) {
horS = v.y * ratioImage * v.y; horS = v.y * ratioImage * v.y;
@@ -416,13 +416,12 @@
top: top top: top
}); });
//si ya une image on re-ajuste au ratio //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') if (width == 'auto')
width = $('#' + settings($.tooltip.current).id).width(); width = $imgTips.get(0).width();
if (height == 'auto') if (height == 'auto')
height = $('#' + settings($.tooltip.current).id).height(); height = $imgTips.get(0).height();
if (ratio > 1) { if (ratio > 1) {
var nh = width / ratio; var nh = width / ratio;
if (nh > height) { if (nh > height) {
@@ -439,7 +438,19 @@
} }
width = nw; 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) { if (vertS < horS) {
height = 'auto'; height = 'auto';
} }
@@ -469,7 +480,7 @@
width = imgWidth + 45; width = imgWidth + 45;
height = imgHeight + 75; height = imgHeight + 75;
console.log('video scaled to ', width, height)
$videoTips.css({ $videoTips.css({
width: Math.round(imgWidth), width: Math.round(imgWidth),
height: Math.round(imgHeight) height: Math.round(imgHeight)

View File

@@ -23,13 +23,7 @@
overflow-y: auto; overflow-y: auto;
} }
.caption-tooltip-container {
max-width: 500px;
}
.caption-tooltip-container .popover-inner .popover-content { .caption-tooltip-container .popover-inner .popover-content {
max-width: 500px;
max-height: 500px;
overflow: auto; overflow: auto;
overflow-x: hidden; overflow-x: hidden;
} }

View File

@@ -10,7 +10,7 @@
{% endif %} {% endif %}
{% if record_type == 'VIDEO_MP4' or record_type == 'VIDEO_FLV' %} {% if record_type == 'VIDEO_MP4' or record_type == 'VIDEO_FLV' %}
<div style="width:{{original_w}}px;height: {{ original_h }}px" class="videoTips"> <div class="videoTips" data-original-width="{{original_w}}" data-original-height="{{original_h}}">
<iframe width="100%" height="100%" <iframe width="100%" height="100%"
src="{{ app['request'].baseUrl }}/embed/datafiles/?url={{ url|url_encode }}&autoplay={{ autoplay|default('false') }}" src="{{ app['request'].baseUrl }}/embed/datafiles/?url={{ url|url_encode }}&autoplay={{ autoplay|default('false') }}"