diff --git a/www/include/jquery.tooltip.js b/www/include/jquery.tooltip.js index c4bc96c019..c251370e80 100644 --- a/www/include/jquery.tooltip.js +++ b/www/include/jquery.tooltip.js @@ -429,8 +429,35 @@ } } - top -= 10; - height += 20; + if(resizeImgTips) + { + var factor = Math.min((width - 45) / width, (height - 75) / height); + var imgWidth = Math.round(width * factor); + var imgHeight = Math.round(height * factor); + + width = imgWidth + 45; + height = imgHeight + 85; + + $imgTips.css({ + maxWidth: imgWidth, + maxHeight: imgHeight + }); + } + + if(resizeVideoTips) + { + var factor = Math.min((width - 45) / width, (height - 75) / height); + var imgWidth = Math.round(width * factor); + var imgHeight = Math.round(height * factor); + + width = imgWidth + 45; + height = imgHeight + 75; + + $videoTips.css({ + width: Math.round(imgWidth), + height: Math.round(imgHeight) + }); + } helper.parent.css({ width: Math.round(width), @@ -439,22 +466,6 @@ top: top }); - if(resizeImgTips) - { - $imgTips.css({ - maxWidth: Math.round(width - 50), - maxHeight: Math.round(height-70) - }); - } - - if(resizeVideoTips) - { - $videoTips.css({ - width: Math.round(width - 50), - height: Math.round(height-70) - }); - } - } }