mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-12 20:43:25 +00:00
fix video tooltips
This commit is contained in:
@@ -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)
|
||||
|
@@ -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;
|
||||
}
|
||||
|
@@ -10,7 +10,7 @@
|
||||
{% endif %}
|
||||
|
||||
{% 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%"
|
||||
src="{{ app['request'].baseUrl }}/embed/datafiles/?url={{ url|url_encode }}&autoplay={{ autoplay|default('false') }}"
|
||||
|
Reference in New Issue
Block a user