Ajax: move ajax event aliases to their own file

Fixes #15126
This commit is contained in:
Timmy Willison 2014-06-02 12:39:11 -04:00
parent 369add5f1d
commit 8530a2fc72
4 changed files with 15 additions and 8 deletions

View File

@ -38,7 +38,7 @@ module.exports = function( grunt ) {
"selector"
],
removeWith: {
ajax: [ "manipulation/_evalUrl" ],
ajax: [ "manipulation/_evalUrl", "event/ajax" ],
callbacks: [ "deferred" ],
css: [ "effects", "dimensions", "offset" ]
}

View File

@ -796,12 +796,5 @@ jQuery.each( [ "get", "post" ], function( i, method ) {
};
});
// Attach a bunch of functions for handling common AJAX events
jQuery.each( [ "ajaxStart", "ajaxStop", "ajaxComplete", "ajaxError", "ajaxSuccess", "ajaxSend" ], function( i, type ) {
jQuery.fn[ type ] = function( fn ) {
return this.on( type, fn );
};
});
return jQuery;
});

13
src/event/ajax.js Normal file
View File

@ -0,0 +1,13 @@
define([
"../core",
"../event"
], function( jQuery ) {
// Attach a bunch of functions for handling common AJAX events
jQuery.each( [ "ajaxStart", "ajaxStop", "ajaxComplete", "ajaxError", "ajaxSuccess", "ajaxSend" ], function( i, type ) {
jQuery.fn[ type ] = function( fn ) {
return this.on( type, fn );
};
});
});

1
src/jquery.js vendored
View File

@ -23,6 +23,7 @@ define([
"./ajax/script",
"./ajax/jsonp",
"./ajax/load",
"./event/ajax",
"./effects",
"./effects/animatedSelector",
"./offset",