icons appended to thumbnail files only in grid view #1351

This commit is contained in:
zuzanna-maria 2024-01-18 13:35:46 +00:00
parent 9bdcb7be67
commit 289cc1e1a4
2 changed files with 31 additions and 0 deletions

View File

@ -634,6 +634,7 @@
}
}
div.cp-app-drive-content-grid {
padding: 1em;
ul {
margin: -(@drive_icon-margin);
@ -667,6 +668,19 @@
font-size: 18px;
}
}
.cp-app-drive-element-icon {
font-size: 12px !important;
float: left !important;
margin: 5px !important;
}
.cp-app-drive-element-name-icon {
text-align: center !important;
float: center !important;
max-width: fit-content !important;
}
.cp-app-drive-element-state {
left: 3px;
}
@ -701,6 +715,10 @@
}
div.cp-app-drive-content-list {
.cp-app-drive-element-icon {
display: none !important;
}
.cp-app-drive-element-grid {
display: none;
}
@ -1030,5 +1048,6 @@
margin: 0 1em;
}
}

View File

@ -2220,6 +2220,7 @@ define([
$element.prepend(img);
$(img).addClass('cp-app-drive-element-grid cp-app-drive-element-thumbnail');
$(img).attr("draggable", false);
addTitle(element, $element, $name)
}
else {
common.displayThumbnail(href || data.roHref, data.channel, data.password, $element, function ($thumb) {
@ -2229,6 +2230,8 @@ define([
$thumb.addClass('cp-app-drive-element-grid cp-app-drive-element-thumbnail');
$thumb.attr("draggable", false);
thumbsUrls[element] = $thumb[0].src;
addTitle(element, $element, $name)
});
}
@ -2245,6 +2248,15 @@ define([
$element.append($type).append($adate).append($cdate);
};
var addTitle = function (element, $element, $name) {
var icon = getFileIcon(element)
$(icon).addClass('cp-app-drive-element-icon')
$name.addClass('cp-app-drive-element-name-icon')
$name.prepend($(icon))
}
var addFolderData = function (element, key, $span) {
if (!element || !manager.isFolder(element)) { return; }
// The element with the class '.name' is underlined when the 'li' is hovered