Refactored "data-confirm", "data-remote" and "data-method" handling on forms and links not to rely on specific event handler ordering. The issue manifested in IE as double confirmation dialogs on forms and executing Ajax request regardless of confirmation outcome. Closes #3
Make sure that ajax events which trigger disabling form buttons really do originate from the form itself and not from any of its descendants.
…rialized this is to enable using "data-disable-with" on submit buttons which are relevant for serialization
do this on "ajax:complete" instead of "ajax:after", which fires just after the ajax requests has been initiated (which is too soon)
this event is useful for modifying the request; e.g. adding HTTP headers
type="submit" is implicit for button elements
Signed-off-by: Joel Nimety <firstname.lastname@example.org>
Fixes the inability to globally observe form submits in Internet Explorer. Doesn't affect the `observe()` method.
"loaded" and "interactive" phases are brittle across browsers and "loading" phase is of little use when we fire "ajax:before"
…odify the DOM before the form is serialized also skip everything early on if the event was stopped
…odify the DOM before the form is serialized
`token` is declared twice, remove one of them; Do not predeclare variables (better compression).