1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-09-05 00:43:53 +00:00

forbid drag&drop on ie brower less than ie11

This commit is contained in:
shanshuirenjia
2019-06-04 15:59:25 +08:00
parent 7756093299
commit 9ba1278eca
2 changed files with 30 additions and 1 deletions

View File

@@ -346,32 +346,49 @@ class DirentListItem extends React.Component {
}
onItemDragStart = (e) => {
if (Utils.isIEBrower()) { // is ie <= ie11 not include edage
return false;
}
let nodeRootPath = '';
nodeRootPath = this.props.path === '/' ? `${this.props.path}${this.props.dirent.name}` : `${this.props.path}/${this.props.dirent.name}`;
let dragStartItemData = {nodeDirent: this.props.dirent, nodeParentPath: this.props.path, nodeRootPath: nodeRootPath};
dragStartItemData = JSON.stringify(dragStartItemData);
e.dataTransfer.effectAllowed = 'move';
e.dataTransfer.setDragImage(this.refs.drag_icon, 15, 15);
if (e.dataTransfer && e.dataTransfer.setDragImage) {
e.dataTransfer.setDragImage(this.refs.drag_icon, 15, 15);
}
e.dataTransfer.setData('applicaiton/drag-item-info', dragStartItemData);
}
onItemDragEnter = () => {
if (Utils.isIEBrower()) { // is ie <= ie11 not include edage
return false;
}
if (this.props.dirent.type === 'dir') {
this.setState({isDropTipshow: true});
}
}
onItemDragOver = (e) => {
if (Utils.isIEBrower()) { // is ie <= ie11 not include edage
return false;
}
e.preventDefault();
e.dataTransfer.dropEffect = 'move';
}
onItemDragLeave = () => {
if (Utils.isIEBrower()) { // is ie <= ie11 not include edage
return false;
}
this.setState({isDropTipshow: false});
}
onItemDragDrop = (e) => {
if (Utils.isIEBrower()) { // is ie <= ie11 not include edage
return false;
}
this.setState({isDropTipshow: false});
if (e.dataTransfer.files.length) { // uploaded files
return;