[WIP] Make popup close on click to anywhere else.

Will make real pull reuqest once `reset-button` is checked in.
The contents of the PR will not change though.