diff options
| author | Cedric Snauwaert <csn@openerp.com> | 2014-07-28 17:07:47 +0200 |
|---|---|---|
| committer | Cedric Snauwaert <csn@openerp.com> | 2014-07-31 17:33:27 +0200 |
| commit | 5ddc0305cd0bef77632ee50fb19ae7372ae5cb68 (patch) | |
| tree | 5e129d4f3e00ac3893d7c1f839cd2a97fe839dd0 /addons/web/static/src/js/core.js | |
| parent | c86f217f7e9d654cb690c6a00c4f87b62d430516 (diff) | |
[FIX] web: fix tooltip that were stuck visible
tooltip stuck visible should be removed on click + remove tooltip container except for modal in order to prevent them for staying visible in some rare occasion
Diffstat (limited to 'addons/web/static/src/js/core.js')
| -rw-r--r-- | addons/web/static/src/js/core.js | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/addons/web/static/src/js/core.js b/addons/web/static/src/js/core.js index 23645e22bf1..47e2a30a3d5 100644 --- a/addons/web/static/src/js/core.js +++ b/addons/web/static/src/js/core.js @@ -772,7 +772,7 @@ instance.web.unblockUI = function() { /* Bootstrap defaults overwrite */ $.fn.tooltip.Constructor.DEFAULTS.placement = 'auto top'; $.fn.tooltip.Constructor.DEFAULTS.html = true; -$.fn.tooltip.Constructor.DEFAULTS.container = 'body'; +$.fn.tooltip.Constructor.DEFAULTS.trigger = 'hover focus click'; //overwrite bootstrap tooltip method to prevent showing 2 tooltip at the same time var bootstrap_show_function = $.fn.tooltip.Constructor.prototype.show; $.fn.tooltip.Constructor.prototype.show = function () { @@ -786,6 +786,18 @@ $.fn.tooltip.Constructor.prototype.show = function () { if (e.isDefaultPrevented() || !inDom) return; return bootstrap_show_function.call(this); }; +//overwrite bootstrap tooltip init method in order to check if tooltip is in a modal or not and +//if so it needs to have a container body in order to be visible +var bootstrap_init_tooltip_fnct = $.fn.tooltip.Constructor.prototype.init; +$.fn.tooltip.Constructor.prototype.init = function (type, element, options) { + options = options || {} + if ($('.modal[aria-hidden="false"]').length !== 0){ + if (options && !options.container){ + options = _.extend({container: 'body'},options); + } + } + return bootstrap_init_tooltip_fnct.call(this, type, element, options); +} /** * Registry for all the client actions key: tag value: widget |
