1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-09-11 03:41:12 +00:00

change metadata file icon url (#6536)

This commit is contained in:
Michael An
2024-08-12 17:08:49 +08:00
committed by GitHub
parent 2e0b75d809
commit 0ec12c0948
3 changed files with 13 additions and 10 deletions

View File

@@ -391,17 +391,17 @@ export const Utils = {
},
getDirentIcon: function (dirent, isBig) {
if (!dirent) return mediaUrl + 'img/file/256/' + this.FILEEXT_ICON_MAP['default'];
let size = this.isHiDPI() ? 48 : 24;
if (!dirent) return mediaUrl + 'img/file/256/' + Utils.FILEEXT_ICON_MAP['default'];
let size = Utils.isHiDPI() ? 48 : 24;
size = isBig ? 192 : size;
if (dirent.isDir()) {
let readonly = false;
if (dirent.permission && (dirent.permission === 'r' || dirent.permission === 'preview')) {
readonly = true;
}
return this.getFolderIconUrl(readonly, size, dirent.has_been_shared_out);
return Utils.getFolderIconUrl(readonly, size, dirent.has_been_shared_out);
} else {
return this.getFileIconUrl(dirent.name);
return Utils.getFileIconUrl(dirent.name);
}
},
@@ -424,15 +424,15 @@ export const Utils = {
getFileIconUrl: function (filename) {
let file_ext = '';
if (filename.lastIndexOf('.') == -1) {
return mediaUrl + 'img/file/256/' + this.FILEEXT_ICON_MAP['default'];
return mediaUrl + 'img/file/256/' + Utils.FILEEXT_ICON_MAP['default'];
} else {
file_ext = filename.substr(filename.lastIndexOf('.') + 1).toLowerCase();
}
if (this.FILEEXT_ICON_MAP[file_ext]) {
return mediaUrl + 'img/file/256/' + this.FILEEXT_ICON_MAP[file_ext];
if (Utils.FILEEXT_ICON_MAP[file_ext]) {
return mediaUrl + 'img/file/256/' + Utils.FILEEXT_ICON_MAP[file_ext];
} else {
return mediaUrl + 'img/file/256/' + this.FILEEXT_ICON_MAP['default'];
return mediaUrl + 'img/file/256/' + Utils.FILEEXT_ICON_MAP['default'];
}
},