0
0
mirror of https://github.com/twbs/bootstrap.git synced 2025-01-17 09:52:29 +01:00
Adrien Jarthon 0e8e5222ff Tooltip/popover: Fix auto placement to use viewport
Currently, auto placement is using the container dimensions (if provided) or the element's parent to determine where to open the tooltip:
```javascript
var $container   = this.options.container ? $(this.options.container) : this.$element.parent()
var containerDim = this.getPosition($container)
```
This is quite broken in fact, because the parent element could be just a small div outside the element for example, leading in a totally random placement (placing the tooltip on top even if there's no room). And the container can also be outside of the viewport.

This fix simply uses the viewport instead, that's the purpose of the viewport actually, to position the tooltip.
So the auto placement should use it to find where there's more room.
By default this is body, which is good.
2015-03-25 18:05:58 +01:00
..
2015-03-16 08:39:31 -07:00
2015-03-16 08:39:31 -07:00
2015-03-16 08:39:31 -07:00
2015-03-16 08:39:31 -07:00
2015-03-16 08:39:31 -07:00
2015-03-16 08:39:31 -07:00
2015-03-16 08:39:31 -07:00
2015-03-16 08:39:31 -07:00
2015-03-16 08:39:31 -07:00