Fixed weird event registration

This fixes click handlers on the document

Fixes https://github.com/owncloud/calendar/issues/463

Please review @MorrisJobke @jancborchardt @wakeup