Skip to content

Commit

Permalink
Merge pull request Studio-42#796 from attozk/2.1
Browse files Browse the repository at this point in the history
CORS and custom headers..
  • Loading branch information
nao-pon committed Mar 4, 2014
2 parents 9179bc7 + 387cf44 commit 165586d
Showing 1 changed file with 20 additions and 2 deletions.
22 changes: 20 additions & 2 deletions js/elFinder.js
Original file line number Diff line number Diff line change
Expand Up @@ -382,7 +382,23 @@ window.elFinder = function(node, opts) {
* @default {}
**/
this.customData = $.isPlainObject(this.options.customData) ? this.options.customData : {};


/**
* Any custom headers to send across every ajax request
*
* @type Object
* @default {}
*/
this.customHeaders = $.isPlainObject(this.options.customHeaders) ? this.options.customHeaders : {};

/**
* Any custom xhrFields to send across every ajax request
*
* @type Object
* @default {}
*/
this.xhrFields = $.isPlainObject(this.options.xhrFields) ? this.options.xhrFields : {};

/**
* ID. Required to create unique cookie name
*
Expand Down Expand Up @@ -896,7 +912,9 @@ window.elFinder = function(node, opts) {
dataType : 'json',
cache : false,
// timeout : 100,
data : data
data : data,
headers : this.customHeaders,
xhrFields: this.xhrFields
}, options.options || {}),
/**
* Default success handler.
Expand Down

0 comments on commit 165586d

Please sign in to comment.