MCPcopy Create free account
hub / github.com/error311/FileRise / fillHoverPreviewForRow

Function fillHoverPreviewForRow

public/js/fileListView.js:3527–4137  ·  view source on GitHub ↗
(row)

Source from the content-addressed store, hash-verified

3525}
3526
3527function fillHoverPreviewForRow(row) {
3528 if (isHoverPreviewDisabled()) {
3529 hideHoverPreview();
3530 return;
3531 }
3532
3533 const el = ensureHoverPreviewEl();
3534 const titleEl = el.querySelector(".hover-preview-title");
3535 const metaEl = el.querySelector(".hover-preview-meta");
3536 const thumbEl = el.querySelector(".hover-preview-thumb");
3537 const propsEl = el.querySelector(".hover-preview-props");
3538 const snippetEl = el.querySelector(".hover-preview-snippet");
3539
3540
3541
3542 if (!titleEl || !metaEl || !thumbEl || !propsEl || !snippetEl) return;
3543
3544// Reset content
3545thumbEl.innerHTML = "";
3546propsEl.innerHTML = "";
3547snippetEl.textContent = "";
3548snippetEl.style.display = "none";
3549metaEl.textContent = "";
3550titleEl.textContent = "";
3551
3552// reset snippet style defaults (for file previews)
3553snippetEl.style.whiteSpace = "pre-wrap";
3554snippetEl.style.overflowX = "auto";
3555snippetEl.style.textOverflow = "clip";
3556snippetEl.style.wordBreak = "break-word";
3557
3558// Reset per-row sizing...
3559thumbEl.style.minHeight = "0";
3560
3561 const isFolder = row.classList.contains("folder-row");
3562
3563 if (isFolder) {
3564 // =========================
3565 // FOLDER HOVER PREVIEW
3566 // =========================
3567 const folderPath = row.dataset.folder || "";
3568 const folderName = folderPath.split("/").pop() || folderPath || "(root)";
3569
3570 titleEl.textContent = folderName;
3571
3572 hoverPreviewContext = {
3573 type: "folder",
3574 folder: folderPath
3575 };
3576
3577 // Right column: icon + path (start props array so we can append later)
3578 const props = [];
3579
3580 props.push(`
3581 <div class="hover-prop-line" style="display:flex;align-items:center;margin-bottom:4px;">
3582 <span class="hover-preview-icon material-icons" style="margin-right:6px;">folder</span>
3583 <strong>${t("folder") || "Folder"}</strong>
3584 </div>

Callers 1

renderFileTableFunction · 0.85

Calls 15

isHoverPreviewDisabledFunction · 0.85
hideHoverPreviewFunction · 0.85
ensureHoverPreviewElFunction · 0.85
tFunction · 0.85
escapeHTMLFunction · 0.85
fetchFolderCapsFunction · 0.85
fetchFolderStatsFunction · 0.85
formatSizeFunction · 0.85
fetchFolderPeekFunction · 0.85
_trimLabelFunction · 0.85
decodeHtmlEntitiesFunction · 0.85
getFileExtFunction · 0.85

Tested by

no test coverage detected