Simplify popup onmousedown logic
Simplify popup onmousedown logic

Use the xAddEventListener instead of directly attaching to
document.onmousedown. Also use a single callback for this event instead
of attaching and detaching every time a new popup is shown or hidden.

sambaker/awe-core