forked from madrobby/zepto
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add "global" Ajax events as well as an extra "ajaxBeforeSend" event
"Global" events aren't really global because Zepto doesn't support them yet. Instead they are simply fired on `document`. Ajax lifecycle is now: 1. ajaxStart (global) – only fired if there are no active requests 2. beforeSend callback (cancellable) 3. ajaxBeforeSend (global, cancellable) 4. ajaxSend (global) 5. success/error callback 6. ajaxSuccess/ajaxError (global) 7. complete callback 8. ajaxComplete (global) 9. ajaxStop (global) – only fired if this is the last active request Also added: - $.active (0) – number of active requests - $.ajaxSettings.global (true) – whether global events will fire If Ajax "context" element is given, "global" events are fired on this element instead of `document` and they bubble.
- Loading branch information
Showing
2 changed files
with
109 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters