You've already forked matrix-react-sdk
mirror of
https://github.com/matrix-org/matrix-react-sdk.git
synced 2025-11-10 09:22:25 +03:00
Allow multiple files to be uploaded at once
fixes vector-im/vector-web#219
This commit is contained in:
@@ -48,8 +48,10 @@ module.exports = React.createClass({
|
||||
onUploadFileSelected: function(ev) {
|
||||
var files = ev.target.files;
|
||||
// MessageComposer shouldn't have to rely on its parent passing in a callback to upload a file
|
||||
if (files && files.length > 0) {
|
||||
this.props.uploadFile(files[0]);
|
||||
if (files) {
|
||||
for(var i=0; i<files.length; i++) {
|
||||
this.props.uploadFile(files[i]);
|
||||
}
|
||||
}
|
||||
this.refs.uploadInput.value = null;
|
||||
},
|
||||
@@ -130,6 +132,7 @@ module.exports = React.createClass({
|
||||
<TintableSvg src="img/upload.svg" width="19" height="24"/>
|
||||
<input ref="uploadInput" type="file"
|
||||
style={uploadInputStyle}
|
||||
multiple
|
||||
onChange={this.onUploadFileSelected} />
|
||||
</div>
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user