update the popup view

this update adds logic for the popup view to automatically reposition
itself if it were to otherwise be rendered off-screen. It also adds a
'close_on_click' attribute to allow disabling of that default
functionality.