twbs/bootstrap — pull request #11593 by benogle (2013-11-22 20:19:29+00:00)
Title: Add tooltip `viewport` option, respect bounds of the viewport

Currently tooltips do not respect their container. eg. I have a button jammed up against the right side of the page, and place a tooltip on the top, it will stick out of the page.

So I added two new options:
* `viewport`: defaults to `'body'`. It's the selector the tip should stay inside.
* `viewportPadding`: how far, in px should it stay from the edges

Since this is visual, I added an example. Not sure how you want this tested. I assume you want unit tests? Is the example sufficient?

Let me know what you need to get this merged. Thanks.

Similar to and inspired by #11347, but adjusting in a different place.