• Adrien Jarthon's avatar
    Tooltip/popover: Fix auto placement to use viewport · 0e8e5222
    Adrien Jarthon authored
    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.
    0e8e5222
Name
Last commit
Last update
dist Loading commit data...
docs Loading commit data...
fonts Loading commit data...
grunt Loading commit data...
js Loading commit data...
less Loading commit data...
test-infra Loading commit data...
.editorconfig Loading commit data...
.gitattributes Loading commit data...
.gitignore Loading commit data...
.travis.yml Loading commit data...
CNAME Loading commit data...
CONTRIBUTING.md Loading commit data...
Gruntfile.js Loading commit data...
LICENSE Loading commit data...
README.md Loading commit data...
_config.yml Loading commit data...
bower.json Loading commit data...
composer.json Loading commit data...
package.js Loading commit data...
package.json Loading commit data...