Merge pull request #921 from ONLYOFFICE/bugfix/shared-drag-n-drop
Web:Client:Home: disable drag
This commit is contained in:
commit
d30f95576b
@ -57,8 +57,11 @@ export default function withFileActions(WrappedFileItem) {
|
||||
};
|
||||
|
||||
onDrop = (items) => {
|
||||
const { isTrashFolder, dragging, setDragging } = this.props;
|
||||
const { fileExst, id } = this.props.item;
|
||||
|
||||
if (isTrashFolder) return dragging && setDragging(false);
|
||||
|
||||
if (!fileExst) {
|
||||
this.onDropZoneUpload(items, id);
|
||||
} else {
|
||||
|
@ -255,8 +255,12 @@ class PureHome extends React.Component {
|
||||
setDragging,
|
||||
dragging,
|
||||
uploadEmptyFolders,
|
||||
disableDrag,
|
||||
} = this.props;
|
||||
dragging && setDragging(false);
|
||||
|
||||
if (disableDrag) return;
|
||||
|
||||
const emptyFolders = files.filter((f) => f.isEmptyDirectory);
|
||||
|
||||
if (emptyFolders.length > 0) {
|
||||
@ -609,6 +613,8 @@ export default inject(
|
||||
refreshFiles,
|
||||
setViewAs,
|
||||
isEmptyPage,
|
||||
|
||||
disableDrag,
|
||||
} = filesStore;
|
||||
|
||||
const { gallerySelected } = oformsStore;
|
||||
@ -616,6 +622,7 @@ export default inject(
|
||||
const {
|
||||
isRecycleBinFolder,
|
||||
isPrivacyFolder,
|
||||
|
||||
expandedKeys,
|
||||
setExpandedKeys,
|
||||
isRoomsFolder,
|
||||
@ -714,6 +721,8 @@ export default inject(
|
||||
isRoomsFolder,
|
||||
isArchiveFolder,
|
||||
|
||||
disableDrag,
|
||||
|
||||
setExpandedKeys,
|
||||
setFirstLoad,
|
||||
setDragging,
|
||||
|
@ -2683,6 +2683,24 @@ class FilesStore {
|
||||
setRoomSecurity = async (id, data) => {
|
||||
return await api.rooms.setRoomSecurity(id, data);
|
||||
};
|
||||
|
||||
get disableDrag() {
|
||||
const {
|
||||
isRecycleBinFolder,
|
||||
isRoomsFolder,
|
||||
isArchiveFolder,
|
||||
isFavoritesFolder,
|
||||
isRecentFolder,
|
||||
} = this.treeFoldersStore;
|
||||
|
||||
return (
|
||||
isRecycleBinFolder ||
|
||||
isRoomsFolder ||
|
||||
isArchiveFolder ||
|
||||
isFavoritesFolder ||
|
||||
isRecentFolder
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
export default FilesStore;
|
||||
|
Loading…
Reference in New Issue
Block a user