parent
25b35a09b9
commit
0eeaac88b4
|
@ -48,8 +48,10 @@ module.exports = React.createClass({
|
||||||
onUploadFileSelected: function(ev) {
|
onUploadFileSelected: function(ev) {
|
||||||
var files = ev.target.files;
|
var files = ev.target.files;
|
||||||
// MessageComposer shouldn't have to rely on its parent passing in a callback to upload a file
|
// MessageComposer shouldn't have to rely on its parent passing in a callback to upload a file
|
||||||
if (files && files.length > 0) {
|
if (files) {
|
||||||
this.props.uploadFile(files[0]);
|
for(var i=0; i<files.length; i++) {
|
||||||
|
this.props.uploadFile(files[i]);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
this.refs.uploadInput.value = null;
|
this.refs.uploadInput.value = null;
|
||||||
},
|
},
|
||||||
|
@ -130,6 +132,7 @@ module.exports = React.createClass({
|
||||||
<TintableSvg src="img/upload.svg" width="19" height="24"/>
|
<TintableSvg src="img/upload.svg" width="19" height="24"/>
|
||||||
<input ref="uploadInput" type="file"
|
<input ref="uploadInput" type="file"
|
||||||
style={uploadInputStyle}
|
style={uploadInputStyle}
|
||||||
|
multiple
|
||||||
onChange={this.onUploadFileSelected} />
|
onChange={this.onUploadFileSelected} />
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
|
Loading…
Reference in New Issue