mirror of
https://github.com/haiwen/seahub.git
synced 2025-08-18 23:18:27 +00:00
fix edit detail failed in image previewer (#7685)
Co-authored-by: zhouwenxuan <aries@Mac.local>
This commit is contained in:
parent
da16173f35
commit
8eb1c65ae3
@ -21,11 +21,6 @@ const EmbeddedFileDetails = ({ repoID, repoInfo, dirent, path, onClose, width =
|
|||||||
return urlParams.has('view');
|
return urlParams.has('view');
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
const isTag = useMemo(() => {
|
|
||||||
const urlParams = new URLSearchParams(window.location.search);
|
|
||||||
return urlParams.has('tag');
|
|
||||||
}, []);
|
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
const fullPath = path.split('/').pop() === dirent?.name ? path : Utils.joinPath(path, dirent?.name || '');
|
const fullPath = path.split('/').pop() === dirent?.name ? path : Utils.joinPath(path, dirent?.name || '');
|
||||||
seafileAPI.getFileInfo(repoID, fullPath).then(res => {
|
seafileAPI.getFileInfo(repoID, fullPath).then(res => {
|
||||||
@ -37,7 +32,7 @@ const EmbeddedFileDetails = ({ repoID, repoInfo, dirent, path, onClose, width =
|
|||||||
}, [repoID, path, dirent]);
|
}, [repoID, path, dirent]);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (isView || isTag) return;
|
if (isView) return;
|
||||||
|
|
||||||
let isExistContext = true;
|
let isExistContext = true;
|
||||||
if (!window.sfMetadataContext) {
|
if (!window.sfMetadataContext) {
|
||||||
|
@ -73,7 +73,7 @@ const TagsEditor = ({ record, value, field, updateFileTags }) => {
|
|||||||
if (!showEditor) return null;
|
if (!showEditor) return null;
|
||||||
const { width, bottom } = ref.current.getBoundingClientRect();
|
const { width, bottom } = ref.current.getBoundingClientRect();
|
||||||
const viewportHeight = window.innerHeight;
|
const viewportHeight = window.innerHeight;
|
||||||
const shouldPlaceBottom = (viewportHeight - bottom) > 300;
|
const shouldPlaceBottom = (viewportHeight - bottom) > 400;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Popover
|
<Popover
|
||||||
@ -84,15 +84,6 @@ const TagsEditor = ({ record, value, field, updateFileTags }) => {
|
|||||||
fade={false}
|
fade={false}
|
||||||
className="sf-metadata-property-editor-popover sf-metadata-tags-property-editor-popover"
|
className="sf-metadata-property-editor-popover sf-metadata-tags-property-editor-popover"
|
||||||
boundariesElement="viewport"
|
boundariesElement="viewport"
|
||||||
popperModifiers={{
|
|
||||||
preventOverflow: {
|
|
||||||
enabled: true,
|
|
||||||
padding: 8
|
|
||||||
},
|
|
||||||
offset: {
|
|
||||||
offset: '0, 8',
|
|
||||||
}
|
|
||||||
}}
|
|
||||||
>
|
>
|
||||||
<Editor
|
<Editor
|
||||||
saveImmediately={true}
|
saveImmediately={true}
|
||||||
|
Loading…
Reference in New Issue
Block a user