On reposition hide the popover if the target is not visible anymore

Hiding popovers when calling reposition and the target element is no longer visible, also removed some undesired whitespace from the source