twitter/bootstrap — pull request #6703 by muanchiou (2013-01-25 14:30:47+00:00)
Title: Move tooltip positioning class to be added before positioning

Tooltip will be positioned wrong when there are position-specific tooltip styles(`.tooltip.right`, `.tooltip.right .tooltip-inner` with styles that change the box-model size), because the offset is calculated before the position classes(right, top, bottom, left) were added.

As shown: http://jsbin.com/esuwuj/3/edit

Simply adding the position class before calculating offset solves this issue.