diff --git a/Dockerfile b/Dockerfile index 5ebe438..ef8091e 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,3 +1,4 @@ FROM nginx:alpine +COPY nginx-default.conf /etc/nginx/conf.d/default.conf COPY index.html /usr/share/nginx/html/index.html EXPOSE 80 diff --git a/index.html b/index.html index 064585e..71dd9d6 100644 --- a/index.html +++ b/index.html @@ -1642,10 +1642,6 @@ function updateAll() { const phases = getPhaseSequence(effective); const totalMonths = estimateMonths(phases); - document.querySelectorAll('.referral-col').forEach(el => { - el.style.display = showRef ? '' : 'none'; - }); - const yr1Cum = estimateYear1Cum(phases, commPct, giftLevel) * numPeople; const yr1PerPerson = estimateYear1Cum(phases, commPct, giftLevel); const totalEG = Math.round(phases.filter(k => k !== '3xL7') @@ -1715,16 +1711,6 @@ ${numPeople > 0 ? ` `; document.getElementById('summaryCards').innerHTML = summaryHtml; - // Toggle referral columns when no people in downline, but respect checkbox - const shouldShow = (numPeople > 0) && showRef; - for (const id of ['headerYourCut','headerCumulative','headerTimelineComm','headerTimelineCum']) { - const el = document.getElementById(id); - if (el) el.style.display = shouldShow ? '' : 'none'; - } - for (const el of document.querySelectorAll('.referral-col')) { - el.style.display = shouldShow ? '' : 'none'; - } - let cumRunning = 0; let roiCum = 0; let roiHit = false; @@ -1850,6 +1836,14 @@ ${numPeople > 0 ? ` } document.getElementById('timelineBody').innerHTML = tRows; + // Referral-column visibility — must run AFTER both tables render, or the + // freshly built cells ignore the toggle while the headers obey it (the + // blank-headers-over-populated-columns bug, 2026-07-30). + const showRefCols = (numPeople > 0) && showRef; + for (const el of document.querySelectorAll('.referral-col')) { + el.style.display = showRefCols ? '' : 'none'; + } + const ctx2 = document.getElementById('timelineChart').getContext('2d'); chart2 = new Chart(ctx2, { type: 'bar', diff --git a/nginx-default.conf b/nginx-default.conf new file mode 100644 index 0000000..58bbc98 --- /dev/null +++ b/nginx-default.conf @@ -0,0 +1,9 @@ +server { + listen 80; + root /usr/share/nginx/html; + index index.html; + # HTML must revalidate every load — deploys were invisible behind + # browser cache. Images/banners keep default caching. + location = /index.html { add_header Cache-Control "no-cache"; } + location = / { add_header Cache-Control "no-cache"; try_files /index.html =404; } +}