Merge branch 'release/v1.2' into feature/inifinite-scroll
This commit is contained in:
commit
9dc7e177be
@ -31,7 +31,7 @@ const FilesMediaViewer = (props) => {
|
|||||||
expandedKeys,
|
expandedKeys,
|
||||||
setScrollToItem,
|
setScrollToItem,
|
||||||
setCurrentId,
|
setCurrentId,
|
||||||
setSelection,
|
setBufferSelection,
|
||||||
} = props;
|
} = props;
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
@ -126,7 +126,7 @@ const FilesMediaViewer = (props) => {
|
|||||||
setIsLoading(false);
|
setIsLoading(false);
|
||||||
setFirstLoad(false);
|
setFirstLoad(false);
|
||||||
setScrollToItem({ id: previewFile.id, type: "file" });
|
setScrollToItem({ id: previewFile.id, type: "file" });
|
||||||
setSelection([previewFile]);
|
setBufferSelection(previewFile);
|
||||||
setToPreviewFile(null);
|
setToPreviewFile(null);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@ -142,7 +142,7 @@ const FilesMediaViewer = (props) => {
|
|||||||
|
|
||||||
setScrollToItem({ id: currentMediaFileId, type: "file" });
|
setScrollToItem({ id: currentMediaFileId, type: "file" });
|
||||||
const targetFile = files.find((item) => item.id === currentMediaFileId);
|
const targetFile = files.find((item) => item.id === currentMediaFileId);
|
||||||
if (targetFile) setSelection([targetFile]);
|
if (targetFile) setBufferSelection(targetFile);
|
||||||
|
|
||||||
window.history.replaceState(null, null, url);
|
window.history.replaceState(null, null, url);
|
||||||
}
|
}
|
||||||
@ -189,7 +189,7 @@ export default inject(
|
|||||||
setIsLoading,
|
setIsLoading,
|
||||||
setFirstLoad,
|
setFirstLoad,
|
||||||
setScrollToItem,
|
setScrollToItem,
|
||||||
setSelection,
|
setBufferSelection,
|
||||||
} = filesStore;
|
} = filesStore;
|
||||||
const {
|
const {
|
||||||
visible,
|
visible,
|
||||||
@ -225,7 +225,7 @@ export default inject(
|
|||||||
expandedKeys,
|
expandedKeys,
|
||||||
setScrollToItem,
|
setScrollToItem,
|
||||||
setCurrentId,
|
setCurrentId,
|
||||||
setSelection,
|
setBufferSelection,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
)(
|
)(
|
||||||
|
@ -93,6 +93,7 @@ const FilesRowContainer = ({
|
|||||||
>
|
>
|
||||||
{filesList.map((item, index) => (
|
{filesList.map((item, index) => (
|
||||||
<SimpleFilesRow
|
<SimpleFilesRow
|
||||||
|
id={`${item?.isFolder ? "folder" : "file"}_${item.id}`}
|
||||||
key={`${item.id}_${index}`}
|
key={`${item.id}_${index}`}
|
||||||
item={item}
|
item={item}
|
||||||
sectionWidth={sectionWidth}
|
sectionWidth={sectionWidth}
|
||||||
|
@ -220,6 +220,7 @@ const SimpleFilesRow = (props) => {
|
|||||||
isAdmin,
|
isAdmin,
|
||||||
getContextModel,
|
getContextModel,
|
||||||
showHotkeyBorder,
|
showHotkeyBorder,
|
||||||
|
id,
|
||||||
} = props;
|
} = props;
|
||||||
|
|
||||||
const withAccess = isAdmin || item.access === 0;
|
const withAccess = isAdmin || item.access === 0;
|
||||||
@ -231,6 +232,7 @@ const SimpleFilesRow = (props) => {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<StyledWrapper
|
<StyledWrapper
|
||||||
|
id={id}
|
||||||
className={`row-wrapper ${
|
className={`row-wrapper ${
|
||||||
showHotkeyBorder
|
showHotkeyBorder
|
||||||
? "row-hotkey-border"
|
? "row-hotkey-border"
|
||||||
|
@ -155,6 +155,7 @@ const Table = ({
|
|||||||
<TableBody>
|
<TableBody>
|
||||||
{filesList.map((item, index) => (
|
{filesList.map((item, index) => (
|
||||||
<TableRow
|
<TableRow
|
||||||
|
id={`${item?.isFolder ? "folder" : "file"}_${item.id}`}
|
||||||
key={`${item.id}_${index}`}
|
key={`${item.id}_${index}`}
|
||||||
item={item}
|
item={item}
|
||||||
index={index}
|
index={index}
|
||||||
|
@ -270,6 +270,7 @@ const FilesTableRow = (props) => {
|
|||||||
getContextModel,
|
getContextModel,
|
||||||
showHotkeyBorder,
|
showHotkeyBorder,
|
||||||
tableColumns,
|
tableColumns,
|
||||||
|
id,
|
||||||
} = props;
|
} = props;
|
||||||
const { acceptBackground, background } = theme.dragAndDrop;
|
const { acceptBackground, background } = theme.dragAndDrop;
|
||||||
|
|
||||||
@ -341,6 +342,7 @@ const FilesTableRow = (props) => {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<StyledDragAndDrop
|
<StyledDragAndDrop
|
||||||
|
id={id}
|
||||||
data-title={item.title}
|
data-title={item.title}
|
||||||
value={value}
|
value={value}
|
||||||
className={`files-item ${className} ${item.id}_${item.fileExst} ${
|
className={`files-item ${className} ${item.id}_${item.fileExst} ${
|
||||||
|
@ -41,6 +41,7 @@ const FileTile = (props) => {
|
|||||||
onHideContextMenu,
|
onHideContextMenu,
|
||||||
thumbSize,
|
thumbSize,
|
||||||
setSelection,
|
setSelection,
|
||||||
|
id,
|
||||||
} = props;
|
} = props;
|
||||||
|
|
||||||
const temporaryExtension =
|
const temporaryExtension =
|
||||||
@ -59,7 +60,7 @@ const FileTile = (props) => {
|
|||||||
);
|
);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div ref={props.selectableRef}>
|
<div ref={props.selectableRef} id={id}>
|
||||||
<DragAndDrop
|
<DragAndDrop
|
||||||
data-title={item.title}
|
data-title={item.title}
|
||||||
value={value}
|
value={value}
|
||||||
|
@ -76,6 +76,7 @@ const FilesTileContainer = ({ filesList, t, sectionWidth }) => {
|
|||||||
{filesList.map((item, index) => {
|
{filesList.map((item, index) => {
|
||||||
return index == 0 ? (
|
return index == 0 ? (
|
||||||
<FileTile
|
<FileTile
|
||||||
|
id={`${item?.isFolder ? "folder" : "file"}_${item.id}`}
|
||||||
key={`${item.id}_${index}`}
|
key={`${item.id}_${index}`}
|
||||||
item={item}
|
item={item}
|
||||||
sectionWidth={sectionWidth}
|
sectionWidth={sectionWidth}
|
||||||
@ -84,6 +85,7 @@ const FilesTileContainer = ({ filesList, t, sectionWidth }) => {
|
|||||||
/>
|
/>
|
||||||
) : (
|
) : (
|
||||||
<FileTile
|
<FileTile
|
||||||
|
id={`${item?.isFolder ? "folder" : "file"}_${item.id}`}
|
||||||
key={`${item.id}_${index}`}
|
key={`${item.id}_${index}`}
|
||||||
item={item}
|
item={item}
|
||||||
sectionWidth={sectionWidth}
|
sectionWidth={sectionWidth}
|
||||||
|
@ -82,9 +82,7 @@ const SectionBodyContent = (props) => {
|
|||||||
if (scrollToItem) {
|
if (scrollToItem) {
|
||||||
const { type, id } = scrollToItem;
|
const { type, id } = scrollToItem;
|
||||||
|
|
||||||
const targetElement = document.querySelector(
|
const targetElement = document.getElementById(`${type}_${id}`);
|
||||||
`div[value='${type}_${id}_draggable']`
|
|
||||||
);
|
|
||||||
|
|
||||||
if (!targetElement) return;
|
if (!targetElement) return;
|
||||||
|
|
||||||
@ -92,12 +90,12 @@ const SectionBodyContent = (props) => {
|
|||||||
|
|
||||||
if (!isInViewport || viewAs === "table") {
|
if (!isInViewport || viewAs === "table") {
|
||||||
const bodyScroll = isMobileOnly
|
const bodyScroll = isMobileOnly
|
||||||
? document.querySelector("#customScrollBar > div")
|
? document.querySelector("#customScrollBar > .scroll-body")
|
||||||
: document.querySelector(".section-scroll");
|
: document.querySelector(".section-scroll");
|
||||||
|
|
||||||
const count =
|
const count =
|
||||||
filesList.findIndex((elem) => elem.id === scrollToItem.id) *
|
filesList.findIndex((elem) => elem.id === scrollToItem.id) *
|
||||||
(isMobileOnly ? 57 : 48);
|
(isMobileOnly ? 57 : viewAs === "table" ? 40 : 48);
|
||||||
|
|
||||||
bodyScroll.scrollTo(0, count);
|
bodyScroll.scrollTo(0, count);
|
||||||
}
|
}
|
||||||
|
@ -694,7 +694,7 @@ class FilesStore {
|
|||||||
);
|
);
|
||||||
|
|
||||||
if (newItem) {
|
if (newItem) {
|
||||||
this.setSelection([newItem]);
|
this.setBufferSelection(newItem);
|
||||||
this.setScrollToItem({
|
this.setScrollToItem({
|
||||||
id: newItem.id,
|
id: newItem.id,
|
||||||
type: this.createdItem.type,
|
type: this.createdItem.type,
|
||||||
|
Loading…
Reference in New Issue
Block a user