|
|
|
@ -5,6 +5,11 @@ export default class DropZone extends React.Component {
|
|
|
|
constructor() {
|
|
|
|
constructor() {
|
|
|
|
super()
|
|
|
|
super()
|
|
|
|
this.state = { focus: false }
|
|
|
|
this.state = { focus: false }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
this.onDragEnter = this.onDragEnter.bind(this)
|
|
|
|
|
|
|
|
this.onDragLeave = this.onDragLeave.bind(this)
|
|
|
|
|
|
|
|
this.onDragOver = this.onDragOver.bind(this)
|
|
|
|
|
|
|
|
this.onDrop = this.onDrop.bind(this)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
onDragEnter() {
|
|
|
|
onDragEnter() {
|
|
|
|
@ -31,10 +36,10 @@ export default class DropZone extends React.Component {
|
|
|
|
|
|
|
|
|
|
|
|
render() {
|
|
|
|
render() {
|
|
|
|
return <div className="drop-zone" ref="root"
|
|
|
|
return <div className="drop-zone" ref="root"
|
|
|
|
onDragEnter={this.onDragEnter.bind(this)}
|
|
|
|
onDragEnter={this.onDragEnter}
|
|
|
|
onDragLeave={this.onDragLeave.bind(this)}
|
|
|
|
onDragLeave={this.onDragLeave}
|
|
|
|
onDragOver={this.onDragOver.bind(this)}
|
|
|
|
onDragOver={this.onDragOver}
|
|
|
|
onDrop={this.onDrop.bind(this)}>
|
|
|
|
onDrop={this.onDrop}>
|
|
|
|
|
|
|
|
|
|
|
|
<div className="drop-zone-overlay"
|
|
|
|
<div className="drop-zone-overlay"
|
|
|
|
hidden={!this.state.focus}
|
|
|
|
hidden={!this.state.focus}
|
|
|
|
|