[FIX] web_tip: don't display tip on element whose width or height is 0

This commit allows a tip to be properly displayed on elements containing
an img tag. Previously the tip would be displayed before the image could
be loaded, thus breaking the ui.
This commit is contained in:
Julien Legros
2014-09-04 17:47:00 +02:00
parent ccf91e067c
commit afba9e8817
+10
View File
@@ -159,6 +159,16 @@
if (trigger_tip) {
self.$element = $(highlight_selector).first();
if (self.$element.height() === 0 || self.$element.width() === 0) {
var $images = self.$element.find('img');
if ($images.length > 0) {
$images.first().load(function() {
self.add_tip(tip);
});
}
return def.reject();
}
var _top = self.$element.offset().top -5;
var _left = self.$element.offset().left -5;
var _width = self.$element.outerWidth() + 10;