diff --git a/src/macros_new/gowlers-tracking-ledger/foundry.gowlershome.dyndns.org/modules/gowlers-tracking-ledger/scripts/gowlers-tracking-ledger.js b/src/macros_new/gowlers-tracking-ledger/foundry.gowlershome.dyndns.org/modules/gowlers-tracking-ledger/scripts/gowlers-tracking-ledger.js index 761a369e..b3eb33fb 100644 --- a/src/macros_new/gowlers-tracking-ledger/foundry.gowlershome.dyndns.org/modules/gowlers-tracking-ledger/scripts/gowlers-tracking-ledger.js +++ b/src/macros_new/gowlers-tracking-ledger/foundry.gowlershome.dyndns.org/modules/gowlers-tracking-ledger/scripts/gowlers-tracking-ledger.js @@ -933,12 +933,9 @@ function buildHistoryContent(actor, tabArg) { { label: "Details", render: (entry) => { - const parts = []; - if (entry.source) parts.push(entry.source); - if (entry.breakdown || entry.amount != null) { - parts.push(entry.breakdown ? entry.breakdown : `${entry.amount} damage`); - } - return parts.join(" → "); + if (entry.breakdown) return entry.breakdown; + if (entry.amount != null) return `${entry.amount} damage`; + return ""; }, getTitle: (entry) => entry.breakdown ?? "", }, @@ -1069,21 +1066,24 @@ function renderHistoryTable(entries, columns, id, rowsPerPage = 10, currentPage const itemsToShow = rowsPerPage === "all" ? entries.length : rowsPerPage; const startIdx = (currentPage - 1) * itemsToShow; const endIdx = startIdx + itemsToShow; - const paginatedEntries = entries.slice(startIdx, endIdx); + const paginatedEntries = entries.slice(startIdx, endIdx); - const rows = paginatedEntries - .map( - (entry) => ` - - ${columns.map((col) => { - const cellContent = col.render(entry) ?? ""; - const title = col.getTitle ? col.getTitle(entry) : ""; - const titleAttr = title ? ` title="${title}"` : ""; - return `${cellContent}`; - }).join("")} - ` - ) - .join(""); + const rows = paginatedEntries + .map( + (entry) => ` + { + const rowTitle = columns.map((col) => (col.getTitle ? col.getTitle(entry) : "")).find((t) => t); + return rowTitle ? ` title="${rowTitle}"` : ""; + })()}> + ${columns.map((col) => { + const cellContent = col.render(entry) ?? ""; + const title = col.getTitle ? col.getTitle(entry) : ""; + const titleAttr = title ? ` title="${title}"` : ""; + return `${cellContent}`; + }).join("")} + ` + ) + .join(""); return `