From ce3eb5543ef0bf244f9277a7c16218119a4950da Mon Sep 17 00:00:00 2001 From: Artem Tarasov Date: Fri, 16 Apr 2021 00:50:52 +0300 Subject: [PATCH] Web: Files: fix drag --- .../pages/Home/Section/Body/FileItem.js | 20 ++++++++++--------- .../Body/FilesTile/sub-components/Tile.js | 1 + 2 files changed, 12 insertions(+), 9 deletions(-) diff --git a/products/ASC.Files/Client/src/components/pages/Home/Section/Body/FileItem.js b/products/ASC.Files/Client/src/components/pages/Home/Section/Body/FileItem.js index e923bbabc7..17bdf2aba1 100644 --- a/products/ASC.Files/Client/src/components/pages/Home/Section/Body/FileItem.js +++ b/products/ASC.Files/Client/src/components/pages/Home/Section/Body/FileItem.js @@ -13,6 +13,7 @@ import Tile from "./FilesTile/sub-components/Tile"; import FilesContent from "./FilesContent"; import SimpleFilesRow from "./FilesRow/SimpleFilesRow"; import { EncryptedFileIcon } from "./sub-components/Icons"; + const svgLoader = () =>
; const FileItem = createSelectable((props) => { @@ -31,7 +32,7 @@ const FileItem = createSelectable((props) => { isPrivacy, isRecycleBin, canShare, - //isFolder, take from item + isFolder, draggable, isRootFolder, actionId, @@ -53,9 +54,10 @@ const FileItem = createSelectable((props) => { contextOptions, icon, providerKey, - isFolder, contentLength, } = item; + + const isMobile = sectionWidth < 500; const getItemIcon = (isEdit) => { return ( <> @@ -127,13 +129,15 @@ const FileItem = createSelectable((props) => { if (!draggable) { return; } - - if ( + /*if ( window.innerWidth < 1025 || e.target.tagName === "rect" || e.target.tagName === "path" ) { return; + }*/ + if (isMobile) { + return; } const mouseButton = e.which ? e.which !== 1 @@ -154,8 +158,6 @@ const FileItem = createSelectable((props) => { const isThirdPartyFolder = providerKey && isRootFolder; //? - const isMobile = sectionWidth < 500; - const isEdit = !!actionType && actionId === id && fileExst === actionExtension; @@ -185,18 +187,18 @@ const FileItem = createSelectable((props) => { return (
{viewAs === "tile" ? ( x.id === item.id && x.fileExst === item.fileExst ); - //const isFolder = selectedItem ? false : item.fileExst ? false : true; + const isFolder = selectedItem ? false : item.fileExst ? false : true; const draggable = !isRecycleBinFolder && selectedItem && selectedItem.id !== id; diff --git a/products/ASC.Files/Client/src/components/pages/Home/Section/Body/FilesTile/sub-components/Tile.js b/products/ASC.Files/Client/src/components/pages/Home/Section/Body/FilesTile/sub-components/Tile.js index faad7d39d5..246ce42c53 100644 --- a/products/ASC.Files/Client/src/components/pages/Home/Section/Body/FilesTile/sub-components/Tile.js +++ b/products/ASC.Files/Client/src/components/pages/Home/Section/Body/FilesTile/sub-components/Tile.js @@ -39,6 +39,7 @@ const StyledFileTileTop = styled.div` padding: 13px; height: 157px; position: relative; + user-select: none; .thumbnailImage { position: absolute;