Fixed weird event registration

This fixes click handlers on the document
Merge pull request #479 from owncloud/fix-documentclick

Fixed weird event registration