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:
@@ -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,
|
||||
|
Reference in New Issue
Block a user