Hide popup menu when clicking outside of it.