diff options
| author | Julien Legros <jle@odoo.com> | 2014-09-04 17:47:00 +0200 |
|---|---|---|
| committer | Julien Legros <jle@odoo.com> | 2014-09-04 17:47:00 +0200 |
| commit | afba9e8817c458640ae446ac7aaaab79be4fe1e9 (patch) | |
| tree | cb79ee3f9cc08d56c55b166e88bda3faf9a8d053 /addons | |
| parent | ccf91e067cc42794355af3f4a26a5056f2baf487 (diff) | |
[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.
Diffstat (limited to 'addons')
| -rw-r--r-- | addons/web_tip/static/src/js/tip.js | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/addons/web_tip/static/src/js/tip.js b/addons/web_tip/static/src/js/tip.js index a07eb533039..c5d6d7c49b7 100644 --- a/addons/web_tip/static/src/js/tip.js +++ b/addons/web_tip/static/src/js/tip.js @@ -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; |
