mirror of
https://github.com/haiwen/seahub.git
synced 2025-09-09 19:01:42 +00:00
@@ -65,7 +65,7 @@ class DirPath extends React.Component {
|
|||||||
|
|
||||||
onDragEnter = (e) => {
|
onDragEnter = (e) => {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
if (Utils.isIEBrower()) {
|
if (Utils.isIEBrowser()) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
this.setState({
|
this.setState({
|
||||||
@@ -75,7 +75,7 @@ class DirPath extends React.Component {
|
|||||||
|
|
||||||
onDragLeave = (e) => {
|
onDragLeave = (e) => {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
if (Utils.isIEBrower()) {
|
if (Utils.isIEBrowser()) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
this.setState({
|
this.setState({
|
||||||
@@ -84,7 +84,7 @@ class DirPath extends React.Component {
|
|||||||
};
|
};
|
||||||
|
|
||||||
onDragOver = (e) => {
|
onDragOver = (e) => {
|
||||||
if (Utils.isIEBrower()) {
|
if (Utils.isIEBrowser()) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
@@ -92,7 +92,7 @@ class DirPath extends React.Component {
|
|||||||
};
|
};
|
||||||
|
|
||||||
onDrop = (e) => {
|
onDrop = (e) => {
|
||||||
if (Utils.isIEBrower()) {
|
if (Utils.isIEBrowser()) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -108,7 +108,7 @@ class DirentGridItem extends React.Component {
|
|||||||
};
|
};
|
||||||
|
|
||||||
onGridItemDragStart = (e) => {
|
onGridItemDragStart = (e) => {
|
||||||
if (Utils.isIEBrower() || !this.canDrag) {
|
if (Utils.isIEBrowser() || !this.canDrag) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -125,7 +125,7 @@ class DirentGridItem extends React.Component {
|
|||||||
};
|
};
|
||||||
|
|
||||||
onGridItemDragEnter = (e) => {
|
onGridItemDragEnter = (e) => {
|
||||||
if (Utils.isIEBrower() || !this.canDrag) {
|
if (Utils.isIEBrowser() || !this.canDrag) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (this.props.dirent.type === 'dir') {
|
if (this.props.dirent.type === 'dir') {
|
||||||
@@ -134,7 +134,7 @@ class DirentGridItem extends React.Component {
|
|||||||
};
|
};
|
||||||
|
|
||||||
onGridItemDragOver = (e) => {
|
onGridItemDragOver = (e) => {
|
||||||
if (Utils.isIEBrower() || !this.canDrag) {
|
if (Utils.isIEBrowser() || !this.canDrag) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
@@ -142,14 +142,14 @@ class DirentGridItem extends React.Component {
|
|||||||
};
|
};
|
||||||
|
|
||||||
onGridItemDragLeave = (e) => {
|
onGridItemDragLeave = (e) => {
|
||||||
if (Utils.isIEBrower() || !this.canDrag) {
|
if (Utils.isIEBrowser() || !this.canDrag) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
this.setState({ isGridDropTipShow: false });
|
this.setState({ isGridDropTipShow: false });
|
||||||
};
|
};
|
||||||
|
|
||||||
onGridItemDragDrop = (e) => {
|
onGridItemDragDrop = (e) => {
|
||||||
if (Utils.isIEBrower() || !this.canDrag) {
|
if (Utils.isIEBrowser() || !this.canDrag) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
this.setState({ isGridDropTipShow: false });
|
this.setState({ isGridDropTipShow: false });
|
||||||
|
@@ -491,7 +491,7 @@ class DirentListItem extends React.Component {
|
|||||||
};
|
};
|
||||||
|
|
||||||
onItemDragStart = (e) => {
|
onItemDragStart = (e) => {
|
||||||
if (Utils.isIEBrower() || !this.state.canDrag) {
|
if (Utils.isIEBrowser() || !this.state.canDrag) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
e.dataTransfer.effectAllowed = 'move';
|
e.dataTransfer.effectAllowed = 'move';
|
||||||
@@ -521,7 +521,7 @@ class DirentListItem extends React.Component {
|
|||||||
};
|
};
|
||||||
|
|
||||||
onItemDragEnter = (e) => {
|
onItemDragEnter = (e) => {
|
||||||
if (Utils.isIEBrower() || !this.state.canDrag) {
|
if (Utils.isIEBrowser() || !this.state.canDrag) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (this.props.dirent.type === 'dir') {
|
if (this.props.dirent.type === 'dir') {
|
||||||
@@ -531,7 +531,7 @@ class DirentListItem extends React.Component {
|
|||||||
};
|
};
|
||||||
|
|
||||||
onItemDragOver = (e) => {
|
onItemDragOver = (e) => {
|
||||||
if (Utils.isIEBrower() || !this.state.canDrag) {
|
if (Utils.isIEBrowser() || !this.state.canDrag) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (e.dataTransfer.dropEffect === 'copy') {
|
if (e.dataTransfer.dropEffect === 'copy') {
|
||||||
@@ -542,7 +542,7 @@ class DirentListItem extends React.Component {
|
|||||||
};
|
};
|
||||||
|
|
||||||
onItemDragLeave = (e) => {
|
onItemDragLeave = (e) => {
|
||||||
if (Utils.isIEBrower() || !this.state.canDrag) {
|
if (Utils.isIEBrowser() || !this.state.canDrag) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -553,7 +553,7 @@ class DirentListItem extends React.Component {
|
|||||||
};
|
};
|
||||||
|
|
||||||
onItemDragDrop = (e) => {
|
onItemDragDrop = (e) => {
|
||||||
if (Utils.isIEBrower() || !this.state.canDrag) {
|
if (Utils.isIEBrowser() || !this.state.canDrag) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
this.setState({ isDropTipshow: false });
|
this.setState({ isDropTipshow: false });
|
||||||
|
@@ -513,7 +513,7 @@ class DirentListView extends React.Component {
|
|||||||
};
|
};
|
||||||
|
|
||||||
onTableDragEnter = (e) => {
|
onTableDragEnter = (e) => {
|
||||||
if (Utils.isIEBrower() || !this.canDrop) {
|
if (Utils.isIEBrowser() || !this.canDrop) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
this.enteredCounter++;
|
this.enteredCounter++;
|
||||||
@@ -526,7 +526,7 @@ class DirentListView extends React.Component {
|
|||||||
};
|
};
|
||||||
|
|
||||||
onTableDragOver = (e) => {
|
onTableDragOver = (e) => {
|
||||||
if (Utils.isIEBrower() || !this.canDrop) {
|
if (Utils.isIEBrowser() || !this.canDrop) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (e.dataTransfer.dropEffect === 'copy') {
|
if (e.dataTransfer.dropEffect === 'copy') {
|
||||||
@@ -537,7 +537,7 @@ class DirentListView extends React.Component {
|
|||||||
};
|
};
|
||||||
|
|
||||||
onTableDragLeave = (e) => {
|
onTableDragLeave = (e) => {
|
||||||
if (Utils.isIEBrower() || !this.canDrop) {
|
if (Utils.isIEBrowser() || !this.canDrop) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
this.enteredCounter--;
|
this.enteredCounter--;
|
||||||
@@ -547,7 +547,7 @@ class DirentListView extends React.Component {
|
|||||||
};
|
};
|
||||||
|
|
||||||
tableDrop = (e) => {
|
tableDrop = (e) => {
|
||||||
if (Utils.isIEBrower() || !this.canDrop) {
|
if (Utils.isIEBrowser() || !this.canDrop) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
e.persist();
|
e.persist();
|
||||||
|
@@ -28,7 +28,7 @@ class DirentsDraggedPreview extends React.Component {
|
|||||||
};
|
};
|
||||||
|
|
||||||
handleDragOver = (event) => {
|
handleDragOver = (event) => {
|
||||||
if (Utils.isIEBrower()) {
|
if (Utils.isIEBrowser()) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
|
@@ -108,14 +108,14 @@ class TreeNodeView extends React.Component {
|
|||||||
};
|
};
|
||||||
|
|
||||||
onNodeDragStart = (e) => {
|
onNodeDragStart = (e) => {
|
||||||
if (Utils.isIEBrower() || !this.canDrag) {
|
if (Utils.isIEBrowser() || !this.canDrag) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
this.props.onNodeDragStart(e, this.props.node);
|
this.props.onNodeDragStart(e, this.props.node);
|
||||||
};
|
};
|
||||||
|
|
||||||
onNodeDragEnter = (e) => {
|
onNodeDragEnter = (e) => {
|
||||||
if (Utils.isIEBrower() || !this.canDrag) {
|
if (Utils.isIEBrowser() || !this.canDrag) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (this.props.node.object.type === 'dir') {
|
if (this.props.node.object.type === 'dir') {
|
||||||
@@ -125,14 +125,14 @@ class TreeNodeView extends React.Component {
|
|||||||
};
|
};
|
||||||
|
|
||||||
onNodeDragMove = (e) => {
|
onNodeDragMove = (e) => {
|
||||||
if (Utils.isIEBrower() || !this.canDrag) {
|
if (Utils.isIEBrowser() || !this.canDrag) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
this.props.onNodeDragMove(e);
|
this.props.onNodeDragMove(e);
|
||||||
};
|
};
|
||||||
|
|
||||||
onNodeDragLeave = (e) => {
|
onNodeDragLeave = (e) => {
|
||||||
if (Utils.isIEBrower() || !this.canDrag) {
|
if (Utils.isIEBrowser() || !this.canDrag) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
this.setState({ isNodeDropShow: false });
|
this.setState({ isNodeDropShow: false });
|
||||||
@@ -140,7 +140,7 @@ class TreeNodeView extends React.Component {
|
|||||||
};
|
};
|
||||||
|
|
||||||
onNodeDrop = (e) => {
|
onNodeDrop = (e) => {
|
||||||
if (Utils.isIEBrower() || !this.canDrag) {
|
if (Utils.isIEBrowser() || !this.canDrag) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
e.stopPropagation();
|
e.stopPropagation();
|
||||||
|
@@ -49,7 +49,7 @@ class TreeView extends React.Component {
|
|||||||
};
|
};
|
||||||
|
|
||||||
onNodeDragStart = (e, node) => {
|
onNodeDragStart = (e, node) => {
|
||||||
if (Utils.isIEBrower()) {
|
if (Utils.isIEBrowser()) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
let dragStartNodeData = { nodeDirent: node.object, nodeParentPath: node.parentNode.path, nodeRootPath: node.path };
|
let dragStartNodeData = { nodeDirent: node.object, nodeParentPath: node.parentNode.path, nodeRootPath: node.path };
|
||||||
@@ -60,7 +60,7 @@ class TreeView extends React.Component {
|
|||||||
};
|
};
|
||||||
|
|
||||||
onNodeDragEnter = (e, node) => {
|
onNodeDragEnter = (e, node) => {
|
||||||
if (Utils.isIEBrower() || !this.canDrop) {
|
if (Utils.isIEBrowser() || !this.canDrop) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
e.persist();
|
e.persist();
|
||||||
@@ -72,7 +72,7 @@ class TreeView extends React.Component {
|
|||||||
};
|
};
|
||||||
|
|
||||||
onNodeDragMove = (e) => {
|
onNodeDragMove = (e) => {
|
||||||
if (Utils.isIEBrower() || !this.canDrop) {
|
if (Utils.isIEBrowser() || !this.canDrop) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
@@ -80,7 +80,7 @@ class TreeView extends React.Component {
|
|||||||
};
|
};
|
||||||
|
|
||||||
onNodeDragLeave = (e, node) => {
|
onNodeDragLeave = (e, node) => {
|
||||||
if (Utils.isIEBrower() || !this.canDrop) {
|
if (Utils.isIEBrowser() || !this.canDrop) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (e.target.className === 'tree-view tree tree-view-drop') {
|
if (e.target.className === 'tree-view tree tree-view-drop') {
|
||||||
@@ -100,7 +100,7 @@ class TreeView extends React.Component {
|
|||||||
};
|
};
|
||||||
|
|
||||||
onNodeDrop = (e, node) => {
|
onNodeDrop = (e, node) => {
|
||||||
if (Utils.isIEBrower() || !this.canDrop) {
|
if (Utils.isIEBrowser() || !this.canDrop) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (e.dataTransfer.files.length) { // uploaded files
|
if (e.dataTransfer.files.length) { // uploaded files
|
||||||
|
@@ -28,7 +28,7 @@ const ViewItem = ({
|
|||||||
return true;
|
return true;
|
||||||
}, [userPerm]);
|
}, [userPerm]);
|
||||||
const canDrop = useMemo(() => {
|
const canDrop = useMemo(() => {
|
||||||
if (Utils.isIEBrower() || !canUpdate) return false;
|
if (Utils.isIEBrowser() || !canUpdate) return false;
|
||||||
return true;
|
return true;
|
||||||
}, [canUpdate]);
|
}, [canUpdate]);
|
||||||
const operations = useMemo(() => {
|
const operations = useMemo(() => {
|
||||||
|
@@ -347,7 +347,7 @@ export const Utils = {
|
|||||||
navigator.userAgent.indexOf('Safari') > -1;
|
navigator.userAgent.indexOf('Safari') > -1;
|
||||||
},
|
},
|
||||||
|
|
||||||
isIEBrower: function () { // is ie <= ie11 not include Edge
|
isIEBrowser: function () { // is ie <= ie11 not include Edge
|
||||||
var userAgent = navigator.userAgent;
|
var userAgent = navigator.userAgent;
|
||||||
var isIE = userAgent.indexOf('compatible') > -1 && userAgent.indexOf('MSIE') > -1;
|
var isIE = userAgent.indexOf('compatible') > -1 && userAgent.indexOf('MSIE') > -1;
|
||||||
var isIE11 = userAgent.indexOf('Trident') > -1 && userAgent.indexOf('rv:11.0') > -1;
|
var isIE11 = userAgent.indexOf('Trident') > -1 && userAgent.indexOf('rv:11.0') > -1;
|
||||||
|
Reference in New Issue
Block a user