fixed closing panels by document click (fixes #186)