fix: drop unused html field from renderDeltaPill (#3)

This commit is contained in:
Samuel Enocsson
2026-05-21 14:23:16 +02:00
parent 0ded27f9df
commit cc223a4b8a
+1 -4
View File
@@ -3,14 +3,11 @@ let pendingPlayerData = null;
let openPdgaNumber = null; let openPdgaNumber = null;
// ── Delta-pill helper ───────────────────────────── // ── Delta-pill helper ─────────────────────────────
// Returns { text, cls, html } — use .text/.cls to update existing DOM elements
// safely; .html is available for insertion contexts.
function renderDeltaPill(value, extraClass) { function renderDeltaPill(value, extraClass) {
if (value == null) return null; if (value == null) return null;
const cls = value > 0 ? 'up' : value < 0 ? 'down' : 'flat'; const cls = value > 0 ? 'up' : value < 0 ? 'down' : 'flat';
const text = value > 0 ? '+' + value : String(value); const text = value > 0 ? '+' + value : String(value);
const extra = extraClass ? ' ' + extraClass : ''; return { text, cls };
return { text, cls, html: `<span class="delta-pill ${cls}${extra}">${text}</span>` };
} }
function setupTooltipsAfterSwap() { function setupTooltipsAfterSwap() {