Skip to content

Commit

Permalink
Ajax: move ajax event aliases to their own file
Browse files Browse the repository at this point in the history
Fixes #15126
  • Loading branch information
timmywil committed Jun 2, 2014
1 parent 3b9057a commit 97c803a
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 8 deletions.
2 changes: 1 addition & 1 deletion Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ module.exports = function( grunt ) {
],
// Exclude specified modules if the module matching the key is removed
removeWith: {
ajax: [ "manipulation/_evalUrl" ],
ajax: [ "manipulation/_evalUrl", "event/ajax" ],
callbacks: [ "deferred" ],
css: [ "effects", "dimensions", "offset" ],
sizzle: [ "css/hiddenVisibleSelectors", "effects/animatedSelector" ]
Expand Down
7 changes: 0 additions & 7 deletions src/ajax.js
Original file line number Diff line number Diff line change
Expand Up @@ -795,12 +795,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 changes: 13 additions & 0 deletions src/event/ajax.js
Original file line number Diff line number Diff line change
@@ -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 change: 1 addition & 0 deletions src/jquery.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ define([
"./ajax/script",
"./ajax/jsonp",
"./ajax/load",
"./event/ajax",
"./effects",
"./effects/animatedSelector",
"./offset",
Expand Down

0 comments on commit 97c803a

Please sign in to comment.