Split DocumentEventHandler logic

Fixed bug with outsideClose event handling