Referral-column toggle applied after tables render (headers+cells stay in sync); nginx no-cache on index.html so deploys reach browsers

This commit is contained in:
Claude (via Marty)
2026-07-30 22:04:41 +00:00
parent 4e2d97af56
commit 63249c2b5d
3 changed files with 18 additions and 14 deletions
+1
View File
@@ -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
+8 -14
View File
@@ -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',
+9
View File
@@ -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; }
}