rc-upload
Advanced tools
Comparing version 1.13.2 to 1.13.3
# History | ||
---- | ||
### 1.14.0 / 2016-06-14 | ||
- https://github.com/react-component/upload/pull/41 | ||
- https://github.com/react-component/upload/pull/40 | ||
### 1.13.0 / 2016-06-02 | ||
@@ -5,0 +10,0 @@ |
@@ -83,6 +83,10 @@ 'use strict'; | ||
uploadFiles: function uploadFiles(files) { | ||
var len = files.length; | ||
var postFiles = Array.prototype.slice.call(files); | ||
if (!this.props.multiple) { | ||
postFiles = postFiles.slice(0, 1); | ||
} | ||
var len = postFiles.length; | ||
if (len > 0) { | ||
for (var i = 0; i < len; i++) { | ||
var file = files.item(i); | ||
var file = postFiles[i]; | ||
file.uid = (0, _uid2['default'])(); | ||
@@ -92,5 +96,5 @@ this.upload(file); | ||
if (this.props.multiple) { | ||
this.props.onStart(Array.prototype.slice.call(files)); | ||
this.props.onStart(postFiles); | ||
} else { | ||
this.props.onStart(Array.prototype.slice.call(files)[0]); | ||
this.props.onStart(postFiles[0]); | ||
} | ||
@@ -110,4 +114,8 @@ } | ||
if (before && before.then) { | ||
before.then(function () { | ||
_this.post(file); | ||
before.then(function (processedFile) { | ||
if (Object.prototype.toString.call(processedFile) === '[object File]') { | ||
_this.post(processedFile); | ||
} else { | ||
_this.post(file); | ||
} | ||
}, function () { | ||
@@ -114,0 +122,0 @@ _this._reset(); |
@@ -35,2 +35,3 @@ 'use strict'; | ||
}; | ||
var IframeUploader = _react2['default'].createClass({ | ||
@@ -63,3 +64,3 @@ displayName: 'IframeUploader', | ||
onLoad: function onLoad() { | ||
if (this.state.disabled) { | ||
if (!this.state.disabled) { | ||
return; | ||
@@ -109,5 +110,5 @@ } | ||
dataSpan.innerHTML = inputs.join(''); | ||
this.disabledIframe(); | ||
formNode.submit(); | ||
dataSpan.innerHTML = ''; | ||
this.disabledIframe(); | ||
}, | ||
@@ -177,2 +178,4 @@ | ||
if (this.state.disabled) { | ||
// hack avoid batch | ||
this.state.disabled = false; | ||
this.setState({ | ||
@@ -186,2 +189,3 @@ disabled: false | ||
if (!this.state.disabled) { | ||
this.state.disabled = true; | ||
this.setState({ | ||
@@ -188,0 +192,0 @@ disabled: true |
{ | ||
"name": "rc-upload", | ||
"version": "1.13.2", | ||
"version": "1.13.3", | ||
"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
23074
529