Skip to content

Commit

Permalink
expands ajaxProtocol so you can give all options to the ajax call
Browse files Browse the repository at this point in the history
  • Loading branch information
Vincent Mans committed Nov 15, 2015
1 parent d70d788 commit 6e14d9d
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions Resources/private/js/bluetea/ajaxProtocol.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,26 @@ $(function() {
this._ajaxData = null;
// Merge options
options = array_merge(this.options.defaults, options);
// Create ajaxOptions
var ajaxOptions = {};
$.each(options, function(index, value) {
switch(index) {
case 'beforeSendCallback':
ajaxOptions['beforeSend'] = value;
break;
case 'readyCallback':
break;
case 'successCallback':
break;
case 'completeCallback':
break;
case 'failCallback':
break;
default:
ajaxOptions[index] = value;
break;
}
});
// Call the URL
$.ajax({
url: options.url,
Expand Down

0 comments on commit 6e14d9d

Please sign in to comment.