popup: hide on scroll and resize (close #376)

cc @narqo @veged