mirror of
https://github.com/ascribe/onion.git
synced 2025-01-03 18:35:09 +01:00
PR Feedback: remove unnecessary DnD functions
This commit is contained in:
parent
3c3e32980c
commit
d888bb8a54
@ -12,14 +12,8 @@ import { getLangText } from '../../../utils/lang_utils';
|
|||||||
// Taken from: https://github.com/fedosejev/react-file-drag-and-drop
|
// Taken from: https://github.com/fedosejev/react-file-drag-and-drop
|
||||||
let FileDragAndDrop = React.createClass({
|
let FileDragAndDrop = React.createClass({
|
||||||
propTypes: {
|
propTypes: {
|
||||||
onDragStart: React.PropTypes.func,
|
|
||||||
onDrop: React.PropTypes.func.isRequired,
|
onDrop: React.PropTypes.func.isRequired,
|
||||||
onDrag: React.PropTypes.func,
|
|
||||||
onDragEnter: React.PropTypes.func,
|
|
||||||
onLeave: React.PropTypes.func,
|
|
||||||
onDragLeave: React.PropTypes.func,
|
|
||||||
onDragOver: React.PropTypes.func,
|
onDragOver: React.PropTypes.func,
|
||||||
onDragEnd: React.PropTypes.func,
|
|
||||||
onInactive: React.PropTypes.func,
|
onInactive: React.PropTypes.func,
|
||||||
filesToUpload: React.PropTypes.array,
|
filesToUpload: React.PropTypes.array,
|
||||||
handleDeleteFile: React.PropTypes.func,
|
handleDeleteFile: React.PropTypes.func,
|
||||||
@ -49,36 +43,6 @@ let FileDragAndDrop = React.createClass({
|
|||||||
allowedExtensions: React.PropTypes.string
|
allowedExtensions: React.PropTypes.string
|
||||||
},
|
},
|
||||||
|
|
||||||
handleDragStart(event) {
|
|
||||||
if (typeof this.props.onDragStart === 'function') {
|
|
||||||
this.props.onDragStart(event);
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
handleDrag(event) {
|
|
||||||
if (typeof this.props.onDrag === 'function') {
|
|
||||||
this.props.onDrag(event);
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
handleDragEnd(event) {
|
|
||||||
if (typeof this.props.onDragEnd === 'function') {
|
|
||||||
this.props.onDragEnd(event);
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
handleDragEnter(event) {
|
|
||||||
if (typeof this.props.onDragEnter === 'function') {
|
|
||||||
this.props.onDragEnter(event);
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
handleDragLeave(event) {
|
|
||||||
if (typeof this.props.onDragLeave === 'function') {
|
|
||||||
this.props.onDragLeave(event);
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
handleDragOver(event) {
|
handleDragOver(event) {
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
|
|
||||||
@ -207,13 +171,9 @@ let FileDragAndDrop = React.createClass({
|
|||||||
return (
|
return (
|
||||||
<div
|
<div
|
||||||
className={updatedClassName}
|
className={updatedClassName}
|
||||||
onDragStart={this.handleDragStart}
|
|
||||||
onDrag={this.handleDrop}
|
onDrag={this.handleDrop}
|
||||||
onDragEnter={this.handleDragEnter}
|
|
||||||
onDragLeave={this.handleDragLeave}
|
|
||||||
onDragOver={this.handleDragOver}
|
onDragOver={this.handleDragOver}
|
||||||
onDrop={this.handleDrop}
|
onDrop={this.handleDrop}>
|
||||||
onDragEnd={this.handleDragEnd}>
|
|
||||||
<FileDragAndDropDialog
|
<FileDragAndDropDialog
|
||||||
multipleFiles={multiple}
|
multipleFiles={multiple}
|
||||||
hasFiles={hasFiles}
|
hasFiles={hasFiles}
|
||||||
|
Loading…
Reference in New Issue
Block a user