|
|
@@ -33,7 +33,7 @@ class IdaUploader {
|
|
|
return function() {};
|
|
|
}
|
|
|
}
|
|
|
- showMsg (msg) {
|
|
|
+ showMsg (msg) {
|
|
|
if (typeof(this.options.showMsgFn)=='function') {
|
|
|
this.options.showMsgFn(msg);
|
|
|
} else {
|
|
|
@@ -41,24 +41,25 @@ class IdaUploader {
|
|
|
}
|
|
|
}
|
|
|
check (file) {
|
|
|
+ debugger
|
|
|
if(Array.isArray(file)){
|
|
|
for(let key in file){
|
|
|
if (this.options.maxSize && (file[key].size > this.options.maxSize)) {
|
|
|
- this.showMsg(this.limitError);
|
|
|
+ this.showMsg(this.options.limitError);
|
|
|
return false;
|
|
|
}
|
|
|
if (this.options.acceptType.length && this.options.acceptType.indexOf(file[key].type) === -1) {
|
|
|
- this.showMsg(this.typeError);
|
|
|
+ this.showMsg(this.options.typeError);
|
|
|
return false;
|
|
|
}
|
|
|
}
|
|
|
}else{
|
|
|
if (this.options.maxSize && (file.size > this.options.maxSize)) {
|
|
|
- this.showMsg(this.limitError);
|
|
|
+ this.showMsg(this.options.limitError);
|
|
|
return false;
|
|
|
}
|
|
|
if (this.options.acceptType.length && this.options.acceptType.indexOf(file.type) === -1) {
|
|
|
- this.showMsg(this.typeError);
|
|
|
+ this.showMsg(this.options.typeError);
|
|
|
return false;
|
|
|
}
|
|
|
}
|