Added an event to be fired when leaving the page

Event will be fired regardless whether form was dirty or clean. An
alternative to "beforeunload", since DirtyForms overrides normal
beforeunload event flow.