1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-09-17 15:53:28 +00:00

folder detail bug repair (#2871)

* folder detail bug repair

* optimized params naming
This commit is contained in:
杨顺强
2019-01-22 16:47:36 +08:00
committed by Daniel Pan
parent ecf704a448
commit 35c1663dc2
2 changed files with 14 additions and 9 deletions

View File

@@ -1,7 +1,6 @@
import React from 'react';
import PropTypes from 'prop-types';
import { Utils } from '../../utils/utils';
import { siteRoot } from '../../utils/constants';
import { seafileAPI } from '../../utils/seafile-api';
import DetailListView from './detail-list-view';
import RepoInfo from '../../models/repo-info';
@@ -95,17 +94,23 @@ class DirentDetail extends React.Component {
render() {
let { dirent } = this.props;
let size = Utils.isHiDPI() ? 48 : 24;
let iconUrl = '';
let smallIconUrl = '';
let bigIconUrl = '';
let smallIconSize = Utils.isHiDPI() ? 48 : 24;
let bigIconSize = 192;
if (dirent.type === 'file') {
iconUrl = Utils.getFileIconUrl(dirent.name, size);
smallIconUrl = Utils.getFileIconUrl(dirent.name, smallIconSize);
bigIconUrl = Utils.getFileIconUrl(dirent.name, bigIconSize);
} else {
let isReadOnly = false;
if (dirent.permission === 'r' || dirent.permission === 'preview') {
isReadOnly = true;
}
iconUrl = Utils.getFolderIconUrl({isReadOnly, size});
let options = {isReadOnly: isReadOnly, size: smallIconSize};
smallIconUrl = Utils.getFolderIconUrl(options);
options.size = bigIconSize;
bigIconUrl = Utils.getFolderIconUrl(options);
}
return (
@@ -113,13 +118,13 @@ class DirentDetail extends React.Component {
<div className="detail-header">
<div className="detail-control sf2-icon-x1" onClick={this.props.onItemDetailsClose}></div>
<div className="detail-title dirent-title">
<div><img src={iconUrl} width="24" alt="" /></div>{' '}
<img src={smallIconUrl} width="24" height="24" alt="" />{' '}
<span className="name ellipsis" title={dirent.name}>{dirent.name}</span>
</div>
</div>
<div className="detail-body dirent-info">
<div className="img">
<img src={iconUrl} width="96" alt="" />
<img src={bigIconUrl} width="96" alt="" />
</div>
{this.state.direntDetail &&
<div className="dirent-table-container">

View File

@@ -57,7 +57,7 @@ class LibDetail extends React.Component {
<div className="detail-header">
<div className="detail-control sf2-icon-x1" onClick={this.props.closeDetails}></div>
<div className="detail-title dirent-title">
<div><img src={titleIcon} width="24" alt="" /></div>{' '}
<img src={titleIcon} width="24" height="24" alt="" />{' '}
<span className="name ellipsis" title={repo.repo_name}>{repo.repo_name}</span>
</div>
</div>