[FIX] web: tooltip container set to body in all case

Mandatory since we changed the structure of the dom since 8.0.
This commit is contained in:
Cedric Snauwaert 2014-08-05 13:55:18 +02:00
parent b09a766f0a
commit 81415b526b
1 changed files with 1 additions and 12 deletions

View File

@ -773,6 +773,7 @@ instance.web.unblockUI = function() {
$.fn.tooltip.Constructor.DEFAULTS.placement = 'auto top';
$.fn.tooltip.Constructor.DEFAULTS.html = true;
$.fn.tooltip.Constructor.DEFAULTS.trigger = 'hover focus click';
$.fn.tooltip.Constructor.DEFAULTS.container = 'body';
//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,18 +787,6 @@ $.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