mirror of
https://github.com/haiwen/seahub.git
synced 2025-09-09 19:01:42 +00:00
optimized getIcon interface (#2904)
* optimized getIcon interface * optimzied get lib-icon code * repair share-repo bug
This commit is contained in:
@@ -125,17 +125,13 @@ class Item extends Component {
|
||||
|
||||
getLinkParams = () => {
|
||||
let item = this.props.item;
|
||||
let icon_size = Utils.isHiDPI() ? 48 : 24;
|
||||
let iconUrl = '';
|
||||
let linkUrl = '';
|
||||
if (item.is_dir) {
|
||||
iconUrl = Utils.getFolderIconUrl({
|
||||
is_readonly: false,
|
||||
size: icon_size
|
||||
});
|
||||
iconUrl = Utils.getFolderIconUrl(false);
|
||||
linkUrl = `${siteRoot}library/${item.repo_id}/${item.repo_name}${Utils.encodePath(item.path)}`;
|
||||
} else {
|
||||
iconUrl = Utils.getFileIconUrl(item.obj_name, icon_size);
|
||||
iconUrl = Utils.getFileIconUrl(item.obj_name);
|
||||
linkUrl = `${siteRoot}lib/${item.repo_id}/file${Utils.encodePath(item.path)}`;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user