This commit is contained in:
zuzanna-maria 2024-01-22 13:22:01 +00:00
parent 289cc1e1a4
commit 1f011b7fe9
2 changed files with 19 additions and 26 deletions

View File

@ -634,7 +634,6 @@
}
}
div.cp-app-drive-content-grid {
padding: 1em;
ul {
margin: -(@drive_icon-margin);
@ -672,13 +671,11 @@
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 {
@ -715,7 +712,6 @@
}
div.cp-app-drive-content-list {
.cp-app-drive-element-icon {
display: none !important;
}
@ -1048,6 +1044,5 @@
margin: 0 1em;
}
}

View File

@ -2150,6 +2150,22 @@ define([
} */
};
var thumbsUrls = {};
// This is duplicated in cryptpad-common, it should be unified
var getFileIcon = function (id) {
var data = manager.getFileData(id);
return UI.getFileIcon(data);
};
var getIcon = UI.getIcon;
var addTitle = function (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 addFileData = function (element, $element) {
if (!manager.isFile(element)) { return; }
@ -2220,9 +2236,8 @@ 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 {
addTitle(element, $name);
} else {
common.displayThumbnail(href || data.roHref, data.channel, data.password, $element, function ($thumb) {
// Called only if the thumbnail exists
// Remove the .hide() added by displayThumnail() because it hides the icon in list mode too
@ -2230,8 +2245,7 @@ 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)
addTitle(element, $name);
});
}
@ -2248,15 +2262,6 @@ 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
@ -2320,13 +2325,6 @@ define([
}
};
// This is duplicated in cryptpad-common, it should be unified
var getFileIcon = function (id) {
var data = manager.getFileData(id);
return UI.getFileIcon(data);
};
var getIcon = UI.getIcon;
var createShareButton = function (id, $container) {
var $shareBlock = $('<button>', {
'class': 'cp-toolbar-share-button',