rc-upload
Advanced tools
Comparing version 2.3.3 to 2.3.4
# History | ||
---- | ||
### 2.3.4 / 2017-03-10 | ||
- disable upload progress listener in request if onPress is not set [!65](https://github.com/react-component/upload/pull/65) | ||
### 2.3.3 / 2017-02-20 | ||
@@ -5,0 +9,0 @@ |
@@ -52,2 +52,3 @@ 'use strict'; | ||
customRequest: _react.PropTypes.func, | ||
onProgress: _react.PropTypes.func, | ||
withCredentials: _react.PropTypes.bool | ||
@@ -124,3 +125,3 @@ }, | ||
})["catch"](function (e) { | ||
console && console.log(e); | ||
console && console.log(e); // eslint-disable-line | ||
}); | ||
@@ -141,3 +142,4 @@ } else if (before !== false) { | ||
var data = props.data; | ||
var onStart = props.onStart; | ||
var onStart = props.onStart, | ||
onProgress = props.onProgress; | ||
@@ -157,5 +159,5 @@ if (typeof data === 'function') { | ||
withCredentials: props.withCredentials, | ||
onProgress: function onProgress(e) { | ||
props.onProgress(e, file); | ||
}, | ||
onProgress: onProgress ? function (e) { | ||
onProgress(e, file); | ||
} : null, | ||
onSuccess: function onSuccess(ret) { | ||
@@ -191,3 +193,6 @@ delete _this2.reqs[uid]; | ||
Object.keys(reqs).forEach(function (uid) { | ||
if (reqs[uid]) reqs[uid].abort(); | ||
if (reqs[uid]) { | ||
reqs[uid].abort(); | ||
} | ||
delete reqs[uid]; | ||
@@ -194,0 +199,0 @@ }); |
@@ -42,3 +42,4 @@ 'use strict'; | ||
var xhr = new XMLHttpRequest(); | ||
if (xhr.upload) { | ||
if (option.onProgress && xhr.upload) { | ||
xhr.upload.onprogress = function progress(e) { | ||
@@ -45,0 +46,0 @@ if (e.total > 0) { |
@@ -61,3 +61,2 @@ 'use strict'; | ||
multipart: false, | ||
onProgress: empty, | ||
onReady: empty, | ||
@@ -64,0 +63,0 @@ onStart: empty, |
{ | ||
"name": "rc-upload", | ||
"version": "2.3.3", | ||
"version": "2.3.4", | ||
"description": "upload ui component for react", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
28805
643