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:
+8
-14
@@ -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',
|
||||
|
||||
Reference in New Issue
Block a user