Hide popup on background tap

I've added a gesture recognizer to the background to be able to close it by tapping on the background (or the original view). I've also added a property to enable this selectively.