Ability to show on top of input element on open

This patch makes the calendar automatically show on top of the element when there's not enough space to display at the bottom of the element.