twitter/bootstrap — pull request #1221 by pokonski (2012-01-25 22:05:24+00:00)
Title: Automatically set Tooltip z-index according to the parent's z-index 

I went ahead and made some changes to fix the z-indexes as described in #1109.
This code automatically sets increased z-index of its parent (if any parent has z-index set at all) to make Tooltips and Popovers visible in `.modal`.

I didn't want to restrict it to a class name so I filter parents by finding the closest one with that CSS attribute set. This way it will work not only in modals but with other elements users might create.

Works fine on Opera/Chrome/Firefox. The only concern might be performance, but in Bootstrap docs even in the worst scenario (Tooltips are not in modals, therefore filter checks parents up to ``) this is only 8 elements to check => no visible slow-downs.

@fat, can you take a look?