Partial protection from popover overflowing viewport.

This makes sure popover don't overflow viewport in top/left direction.
Merge pull request #61 from glubo/leak_protection

Partial protection from popover overflowing viewport.