twitter/bootstrap — pull request #6321 by Yohn (2012-12-19 05:21:25+00:00)
Title: fixes tooltip insert problems

This adds a container option to the tooltip that can be called via html5 - `data-container="body"` or javascript - `$().tooltip({container: 'body'})`

if no container is given then it will get the default `insertAfter()` strategy

This fixes a number of bugs that were introduced when we changed the `appendTo()` to `insertAfter()` including bringing back the option to use 'in' for the placement like so -- `placement: 'in right'` so it doesnt break current projects using this technique

If the tooltips are within a modal, and are inheriting its parents styles, then use `$().tooltip({container: '#modalID'})`

Its recommended to use the container option rather than the 'in' placement as sometimes the position is a little off if its used within a modal.

heres a fiddle to show the changes - http://jsfiddle.net/yohn/R23KB/14/

thanks to @WilliamStam, @thelonecabbage, and @blakeembrey for helping with this solution

some issues that noticed this bug
#5687 #6254 #6314 #6306 #6283 #6275 #6250 #6240 #6236 along with a lot more..