Adding event delegation

Delegated the modal events to the $root.