angular-ui/bootstrap — pull request #2060 by mtraynham (2014-04-14 17:04:11+00:00)
Title: fix(datepicker): position on screen

Fixes Bug #1837. This is jqlite compatible.

This solution alters the suggested positioning with the height/width of the popup element. To achieve the offsetWidth/offsetHeight of the popup, I used the jquery trick of setting the display to block which generates the offsetWidth/offsetHeight and then set it back after calculation.

I know there is already a pull request (PR #1838) for this, but it was answered from 2 months ago, required jQuery and also didn't compensate for the left/top and right boundaries.