popup: closes when you do mousedown on it, drag to body, and mouseup on body

/cc @narqo  @dfilatov