mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-05-19 17:14:57 +00:00
35 lines
1.0 KiB
JavaScript
35 lines
1.0 KiB
JavaScript
var CommentBox = React.createClass({
|
|
getInitialState: function() {
|
|
return { accept: 'image/*', action: 'http://localhost:8888/alfresco/service/api/upload', droppable: ''};
|
|
},
|
|
|
|
onChangeAccept: function(e) {
|
|
this.setState({accept: e.target.value});
|
|
},
|
|
|
|
onChangeAction: function(e) {
|
|
this.setState({action: e.target.value});
|
|
},
|
|
|
|
onChangeDroppable: function(e) {
|
|
this.setState({droppable: e.target.checked});
|
|
},
|
|
|
|
render: function() {
|
|
return (
|
|
<div className="commentBox">
|
|
<div>
|
|
<form>
|
|
<file-upload raised='true' accept={this.state.accept} droppable='false' target={this.state.action} multi='false' ><iron-icon icon="icons:add"></iron-icon> Add File</file-upload>
|
|
</form>
|
|
<alfresco-file-list></alfresco-file-list>
|
|
</div>
|
|
</div>
|
|
);
|
|
}
|
|
});
|
|
ReactDOM.render(
|
|
<CommentBox />,
|
|
document.getElementById('example')
|
|
);
|