uploadStart : function(file, crop)
{
- var xhr = new XMLHttpRequest();
+ this.xhr = new XMLHttpRequest();
if(typeof(file.id) != 'undefined' && file.id * 1 > 0){
this.arrange();
return;
}
- file.xhr = xhr;
+ file.xhr = this.xhr;
this.managerEl.createChild({
tag : 'div',
});
- xhr.open(this.method, this.url, true);
+ this.xhr.open(this.method, this.url, true);
var headers = {
"Accept": "application/json",
for (var headerName in headers) {
var headerValue = headers[headerName];
if (headerValue) {
- xhr.setRequestHeader(headerName, headerValue);
+ this.xhr.setRequestHeader(headerName, headerValue);
}
}
var _this = this;
- xhr.onload = function()
+ this.xhr.onload = function()
{
- _this.xhrOnLoad(xhr);
+ _this.xhrOnLoad(this.xhr);
}
- xhr.onerror = function()
+ this.xhr.onerror = function()
{
- _this.xhrOnError(xhr);
+ _this.xhrOnError(this.xhr);
}
var formData = new FormData();
formData.append(this.paramName, file, file.name);
if(this.fireEvent('prepare', this, formData) != false){
- xhr.send(formData);
+ this.xhr.send(formData);
};
}