pdf fix and alignment

This commit is contained in:
Ryan
2025-03-15 18:53:54 -04:00
committed by GitHub
parent e43732bf38
commit a426ac5dfe
2 changed files with 9 additions and 5 deletions

View File

@@ -217,7 +217,7 @@ export function renderFileTable(folder) {
let previewIcon = "";
if (/\.(jpg|jpeg|png|gif|bmp|webp|svg|ico|tif|tiff|eps|heic)$/i.test(file.name)) {
previewIcon = `<i class="material-icons">image</i>`;
} else if (/\.(mp4|webm|mov|ogg)$/i.test(file.name)) {
} else if (/\.(mp4|webm|ogg)$/i.test(file.name)) {
previewIcon = `<i class="material-icons">videocam</i>`;
} else if (/\.pdf$/i.test(file.name)) {
previewIcon = `<i class="material-icons">picture_as_pdf</i>`;
@@ -356,9 +356,10 @@ window.previewFile = function (fileUrl, fileName) {
} else if (extension === "pdf") {
// PDF preview using <embed> with explicit sizing
const embed = document.createElement("embed");
embed.src = fileUrl;
// Append a timestamp to force reload
const separator = fileUrl.indexOf('?') === -1 ? '?' : '&';
embed.src = fileUrl + separator + 't=' + new Date().getTime();
embed.type = "application/pdf";
// Instead of using the image-modal-img class, set larger dimensions
embed.style.width = "80vw";
embed.style.height = "80vh";
embed.style.border = "none";

View File

@@ -1216,7 +1216,7 @@ body.dark-mode #fileListContainer {
=========================================================== */
.folder-tree {
list-style-type: none;
padding-left: 25px;
padding-left: 10px;
margin: 0;
}
@@ -1236,11 +1236,14 @@ body.dark-mode #fileListContainer {
.folder-toggle {
cursor: pointer;
margin-right: 5px;
display: inline-block;
width: 25px; /* or adjust to desired width */
text-align: right;
}
.folder-indent-placeholder {
display: inline-block;
width: 0px;
width: 30px;
}
.folder-option {