Fix basket tooltip display

This commit is contained in:
Romain Neutron
2012-02-17 13:19:23 +01:00
parent 153c43fd09
commit 9889ac720e
3 changed files with 65 additions and 64 deletions

View File

@@ -1,5 +1,5 @@
{% import 'common/thumbnail.html' as thumbnail %} {% import 'common/thumbnail.html' as thumbnail %}
<div style="margin:5px;width:280px;height:300px;position:relative;"> <div class="noToolTipResize" style="margin:5px;width:280px;height:300px;position:relative;">
<div> <div>
<span style="font-weight:bold;font-size:14px;"> <span style="font-weight:bold;font-size:14px;">
{{ basket.getName() }} {{ basket.getName() }}
@@ -15,13 +15,15 @@
{{ nb_records }} records {{ nb_records }} records
{% endtrans %} {% endtrans %}
- {{ date }} - {{ date }}
<hr/> <hr/>
<div style="position:relative;float:left;width:270px;"> <div style="position:relative;float:left;width:270px;">
{% for element in basket.getElements() %} {% for element in basket.getElements() %}
{% if loop.index <= 9 %} {% if loop.index <= 9 %}
<div style="margin:5px;position:relative;float:left;width:80px;height:80px;overflow:hidden;"> <div style="margin:5px;position:relative;float:left;width:80px;height:80px;overflow:hidden;">
{{ thumbnail.format(element.getRecord().get_thumbnail(), 80, 80 , '', session) }} {{ thumbnail.format(element.getRecord().get_thumbnail(), 80, 80 , '', session) }}
</div> </div>
{% endif %} {% endif %}
{% endfor %} {% endfor %}
</div>
</div> </div>
</div>

View File

@@ -1,5 +1,5 @@
{% import 'common/thumbnail.html' as thumbnail %} {% import 'common/thumbnail.html' as thumbnail %}
<div style="margin:5px;width:280px;height:300px;position:relative;"> <div class="noToolTipResize" style="margin:5px;width:280px;height:300px;position:relative;">
<div> <div>
<span style="font-weight:bold;font-size:14px;"> <span style="font-weight:bold;font-size:14px;">
{{ Story.get_title() }} {{ Story.get_title() }}
@@ -15,13 +15,15 @@
{{ nb_records }} records {{ nb_records }} records
{% endtrans %} {% endtrans %}
- {{ date }} - {{ date }}
<hr/> <hr/>
<div style="position:relative;float:left;width:270px;"> <div style="position:relative;float:left;width:270px;">
{% for element in Story.get_children().get_elements() %} {% for element in Story.get_children().get_elements() %}
{% if loop.index <= 9 %} {% if loop.index <= 9 %}
<div style="margin:5px;position:relative;float:left;width:80px;height:80px;overflow:hidden;"> <div style="margin:5px;position:relative;float:left;width:80px;height:80px;overflow:hidden;">
{{ thumbnail.format(element.get_thumbnail(), 80, 80 , '', session) }} {{ thumbnail.format(element.get_thumbnail(), 80, 80 , '', session) }}
</div> </div>
{% endif %} {% endif %}
{% endfor %} {% endfor %}
</div>
</div> </div>
</div>

View File

@@ -251,8 +251,11 @@
var width = 'auto'; var width = 'auto';
var height = 'auto'; var height = 'auto';
var ratio = 1; var ratio = 1;
var resizeImgTips = false;
var $imgTips = $('#' + settings($.tooltip.current).id + ' .imgTips'); var $imgTips = $('#' + settings($.tooltip.current).id + ' .imgTips');
if ($imgTips[0]) {
if ($imgTips[0] && $('#' + settings($.tooltip.current).id + ' .noToolTipResize').length === 0) {
resizeImgTips = true;
width = parseInt($imgTips[0].style.width); width = parseInt($imgTips[0].style.width);
height = parseInt($imgTips[0].style.height); height = parseInt($imgTips[0].style.height);
ratio = width/height; ratio = width/height;
@@ -325,7 +328,7 @@
//correction par ratio //correction par ratio
if ($('#' + settings($.tooltip.current).id + ' .imgTips')[0]) { if (resizeImgTips && $('#' + settings($.tooltip.current).id + ' .imgTips')[0]) {
if(ratioSurfaceH > ratioImage) if(ratioSurfaceH > ratioImage)
{ {
@@ -403,7 +406,7 @@
//si ya une image on re-ajuste au ratio //si ya une image on re-ajuste au ratio
if ($('#' + settings($.tooltip.current).id + ' .imgTips')[0]) { if (resizeImgTips && $('#' + settings($.tooltip.current).id + ' .imgTips')[0]) {
if(width == 'auto') if(width == 'auto')
width = $('#' + settings($.tooltip.current).id).width(); width = $('#' + settings($.tooltip.current).id).width();
if(height == 'auto') if(height == 'auto')
@@ -439,20 +442,14 @@
top: top top: top
}); });
$imgTips.css({ if(resizeImgTips)
width: width, {
height: height $imgTips.css({
// , width: width,
// left: left, height: height
// top: top });
}); }
// if($imgTips.size() > 0)
// {
// $('#' + settings($.tooltip.current).id).image_enhance('destroy').image_enhance({
// zoomable:true
// });
// }
} }
} }