Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tooltip/popover: Fix auto placement to use viewport #16152

Merged
merged 3 commits into from
Apr 27, 2015
Merged

Tooltip/popover: Fix auto placement to use viewport #16152

merged 3 commits into from
Apr 27, 2015

Commits on Mar 25, 2015

  1. 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.
    jarthod committed Mar 25, 2015
    Configuration menu
    Copy the full SHA
    0e8e522 View commit details
    Browse the repository at this point in the history

Commits on Mar 29, 2015

  1. Configuration menu
    Copy the full SHA
    df96c3e View commit details
    Browse the repository at this point in the history
  2. fixed IE incompatible CSS

    jarthod committed Mar 29, 2015
    Configuration menu
    Copy the full SHA
    5921724 View commit details
    Browse the repository at this point in the history