mirror of
https://github.com/haiwen/seahub.git
synced 2025-09-01 07:01:12 +00:00
forbid drag&drop on ie brower less than ie11
This commit is contained in:
@@ -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;
|
||||
|
@@ -537,23 +537,35 @@ class DirentListView extends React.Component {
|
||||
}
|
||||
|
||||
onTableDragEnter = (e) => {
|
||||
if (Utils.isIEBrower()) {
|
||||
return false;
|
||||
}
|
||||
if (e.target.className === 'table-container ') {
|
||||
this.setState({isListDropTipShow: true});
|
||||
}
|
||||
}
|
||||
|
||||
onTableDragOver = (e) => {
|
||||
if (Utils.isIEBrower) {
|
||||
return false;
|
||||
}
|
||||
e.preventDefault();
|
||||
e.dataTransfer.dropEffect = 'move';
|
||||
}
|
||||
|
||||
onTableDragLeave = (e) => {
|
||||
if (Utils.isIEBrower) {
|
||||
return false;
|
||||
}
|
||||
if (e.target.className === 'table-container table-drop-active') {
|
||||
this.setState({isListDropTipShow: false});
|
||||
}
|
||||
}
|
||||
|
||||
tableDrop = (e) => {
|
||||
if (Utils.isIEBrower) {
|
||||
return false;
|
||||
}
|
||||
e.persist();
|
||||
this.setState({isListDropTipShow: false});
|
||||
if (e.dataTransfer.files.length) { // uploaded files
|
||||
|
Reference in New Issue
Block a user