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 %}
<div style="margin:5px;width:280px;height:300px;position:relative;">
<div class="noToolTipResize" style="margin:5px;width:280px;height:300px;position:relative;">
<div>
<span style="font-weight:bold;font-size:14px;">
{{ basket.getName() }}
@@ -25,3 +25,5 @@
{% endif %}
{% endfor %}
</div>
</div>
</div>

View File

@@ -1,5 +1,5 @@
{% 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>
<span style="font-weight:bold;font-size:14px;">
{{ Story.get_title() }}
@@ -25,3 +25,5 @@
{% endif %}
{% endfor %}
</div>
</div>
</div>

View File

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