mirror of
https://github.com/haiwen/seahub.git
synced 2025-09-01 15:09:14 +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) => {
|
onItemDragStart = (e) => {
|
||||||
|
if (Utils.isIEBrower()) { // is ie <= ie11 not include edage
|
||||||
|
return false;
|
||||||
|
}
|
||||||
let nodeRootPath = '';
|
let nodeRootPath = '';
|
||||||
nodeRootPath = this.props.path === '/' ? `${this.props.path}${this.props.dirent.name}` : `${this.props.path}/${this.props.dirent.name}`;
|
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};
|
let dragStartItemData = {nodeDirent: this.props.dirent, nodeParentPath: this.props.path, nodeRootPath: nodeRootPath};
|
||||||
dragStartItemData = JSON.stringify(dragStartItemData);
|
dragStartItemData = JSON.stringify(dragStartItemData);
|
||||||
|
|
||||||
e.dataTransfer.effectAllowed = 'move';
|
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);
|
e.dataTransfer.setData('applicaiton/drag-item-info', dragStartItemData);
|
||||||
}
|
}
|
||||||
|
|
||||||
onItemDragEnter = () => {
|
onItemDragEnter = () => {
|
||||||
|
if (Utils.isIEBrower()) { // is ie <= ie11 not include edage
|
||||||
|
return false;
|
||||||
|
}
|
||||||
if (this.props.dirent.type === 'dir') {
|
if (this.props.dirent.type === 'dir') {
|
||||||
this.setState({isDropTipshow: true});
|
this.setState({isDropTipshow: true});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
onItemDragOver = (e) => {
|
onItemDragOver = (e) => {
|
||||||
|
if (Utils.isIEBrower()) { // is ie <= ie11 not include edage
|
||||||
|
return false;
|
||||||
|
}
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
e.dataTransfer.dropEffect = 'move';
|
e.dataTransfer.dropEffect = 'move';
|
||||||
}
|
}
|
||||||
|
|
||||||
onItemDragLeave = () => {
|
onItemDragLeave = () => {
|
||||||
|
if (Utils.isIEBrower()) { // is ie <= ie11 not include edage
|
||||||
|
return false;
|
||||||
|
}
|
||||||
this.setState({isDropTipshow: false});
|
this.setState({isDropTipshow: false});
|
||||||
}
|
}
|
||||||
|
|
||||||
onItemDragDrop = (e) => {
|
onItemDragDrop = (e) => {
|
||||||
|
if (Utils.isIEBrower()) { // is ie <= ie11 not include edage
|
||||||
|
return false;
|
||||||
|
}
|
||||||
this.setState({isDropTipshow: false});
|
this.setState({isDropTipshow: false});
|
||||||
if (e.dataTransfer.files.length) { // uploaded files
|
if (e.dataTransfer.files.length) { // uploaded files
|
||||||
return;
|
return;
|
||||||
|
@@ -537,23 +537,35 @@ class DirentListView extends React.Component {
|
|||||||
}
|
}
|
||||||
|
|
||||||
onTableDragEnter = (e) => {
|
onTableDragEnter = (e) => {
|
||||||
|
if (Utils.isIEBrower()) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
if (e.target.className === 'table-container ') {
|
if (e.target.className === 'table-container ') {
|
||||||
this.setState({isListDropTipShow: true});
|
this.setState({isListDropTipShow: true});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
onTableDragOver = (e) => {
|
onTableDragOver = (e) => {
|
||||||
|
if (Utils.isIEBrower) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
e.dataTransfer.dropEffect = 'move';
|
e.dataTransfer.dropEffect = 'move';
|
||||||
}
|
}
|
||||||
|
|
||||||
onTableDragLeave = (e) => {
|
onTableDragLeave = (e) => {
|
||||||
|
if (Utils.isIEBrower) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
if (e.target.className === 'table-container table-drop-active') {
|
if (e.target.className === 'table-container table-drop-active') {
|
||||||
this.setState({isListDropTipShow: false});
|
this.setState({isListDropTipShow: false});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
tableDrop = (e) => {
|
tableDrop = (e) => {
|
||||||
|
if (Utils.isIEBrower) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
e.persist();
|
e.persist();
|
||||||
this.setState({isListDropTipShow: false});
|
this.setState({isListDropTipShow: false});
|
||||||
if (e.dataTransfer.files.length) { // uploaded files
|
if (e.dataTransfer.files.length) { // uploaded files
|
||||||
|
Reference in New Issue
Block a user