[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:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user