diff --git a/src/BootstrapTooltip/BootstrapTooltip.xml b/src/BootstrapTooltip/BootstrapTooltip.xml index c8d983d..a3fd0c2 100644 --- a/src/BootstrapTooltip/BootstrapTooltip.xml +++ b/src/BootstrapTooltip/BootstrapTooltip.xml @@ -49,6 +49,12 @@ Data source Return value: Text to display in tooltip. + + + Use body container + Appearance + Place the tooltip on the body instead of the container. Use this option if the tooltip displays small because of it's container. + Using this option places the tooltip on the body instead of the container which makes styling a lot easier, but the position of the tooltip won't change correctly when resizing the browser. diff --git a/src/BootstrapTooltip/BootstrapTooltipContext.xml b/src/BootstrapTooltip/BootstrapTooltipContext.xml index cd1db39..a1fe1f2 100644 --- a/src/BootstrapTooltip/BootstrapTooltipContext.xml +++ b/src/BootstrapTooltip/BootstrapTooltipContext.xml @@ -76,6 +76,11 @@ - + + Use body container + Appearance + Place the tooltip on the body instead of the container. Use this option if the tooltip displays small because of it's container. + Using this option places the tooltip on the body instead of the container which makes styling a lot easier, but the position of the tooltip won't change correctly when resizing the browser. + diff --git a/src/BootstrapTooltip/widget/BootstrapTooltip.js b/src/BootstrapTooltip/widget/BootstrapTooltip.js index 43b5925..d1db759 100644 --- a/src/BootstrapTooltip/widget/BootstrapTooltip.js +++ b/src/BootstrapTooltip/widget/BootstrapTooltip.js @@ -76,11 +76,12 @@ define([ $targetElement = $targetElement.find(".form-control").length !== 0 ? $targetElement.find(".form-control") : $targetElement.find("input"); } - $targetElement.tooltip({ + $targetElement.data('bs.tooltip',false).tooltip({ title: this._tooltipText, placement: this.tooltipLocation, trigger: this._tooltipTrigger, - html : this.tooltipRenderHTML + html : this.tooltipRenderHTML, + container: this.useBodyAsContainer ? 'body' : false }); this._executeCallback(cb, "_initializeTooltip");