1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-09-03 16:10:26 +00:00

replace thumbnail by original image (#5634)

This commit is contained in:
杨顺强
2023-09-11 17:19:17 +08:00
committed by GitHub
parent e6cfe37180
commit d829ba5b23
2 changed files with 7 additions and 26 deletions

View File

@@ -1,6 +1,6 @@
import React, { Fragment } from 'react';
import PropTypes from 'prop-types';
import { siteRoot, gettext, thumbnailSizeForOriginal, username } from '../../utils/constants';
import { siteRoot, gettext, username } from '../../utils/constants';
import { Utils } from '../../utils/utils';
import TextTranslation from '../../utils/text-translation';
import URLDecorator from '../../utils/url-decorator';
@@ -155,20 +155,10 @@ class DirentListView extends React.Component {
// for image popup
prepareImageItem = (item) => {
const useThumbnail = !this.repoEncrypted;
const name = item.name;
const fileExt = name.substr(name.lastIndexOf('.') + 1).toLowerCase();
const isGIF = fileExt == 'gif';
const path = Utils.encodePath(Utils.joinPath(this.props.path, name));
const repoID = this.props.repoID;
let src;
if (useThumbnail && !isGIF) {
src = `${siteRoot}thumbnail/${repoID}/${thumbnailSizeForOriginal}${path}`;
} else {
src = `${siteRoot}repo/${repoID}/raw${path}`;
}
const path = Utils.encodePath(Utils.joinPath(this.props.path, name));
const src = `${siteRoot}repo/${repoID}/raw${path}`;
return {
'name': name,