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:
@@ -1,3 +1,4 @@
|
|||||||
FROM nginx:alpine
|
FROM nginx:alpine
|
||||||
|
COPY nginx-default.conf /etc/nginx/conf.d/default.conf
|
||||||
COPY index.html /usr/share/nginx/html/index.html
|
COPY index.html /usr/share/nginx/html/index.html
|
||||||
EXPOSE 80
|
EXPOSE 80
|
||||||
|
|||||||
+8
-14
@@ -1642,10 +1642,6 @@ function updateAll() {
|
|||||||
const phases = getPhaseSequence(effective);
|
const phases = getPhaseSequence(effective);
|
||||||
const totalMonths = estimateMonths(phases);
|
const totalMonths = estimateMonths(phases);
|
||||||
|
|
||||||
document.querySelectorAll('.referral-col').forEach(el => {
|
|
||||||
el.style.display = showRef ? '' : 'none';
|
|
||||||
});
|
|
||||||
|
|
||||||
const yr1Cum = estimateYear1Cum(phases, commPct, giftLevel) * numPeople;
|
const yr1Cum = estimateYear1Cum(phases, commPct, giftLevel) * numPeople;
|
||||||
const yr1PerPerson = estimateYear1Cum(phases, commPct, giftLevel);
|
const yr1PerPerson = estimateYear1Cum(phases, commPct, giftLevel);
|
||||||
const totalEG = Math.round(phases.filter(k => k !== '3xL7')
|
const totalEG = Math.round(phases.filter(k => k !== '3xL7')
|
||||||
@@ -1715,16 +1711,6 @@ ${numPeople > 0 ? `
|
|||||||
`;
|
`;
|
||||||
document.getElementById('summaryCards').innerHTML = summaryHtml;
|
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 cumRunning = 0;
|
||||||
let roiCum = 0;
|
let roiCum = 0;
|
||||||
let roiHit = false;
|
let roiHit = false;
|
||||||
@@ -1850,6 +1836,14 @@ ${numPeople > 0 ? `
|
|||||||
}
|
}
|
||||||
document.getElementById('timelineBody').innerHTML = tRows;
|
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');
|
const ctx2 = document.getElementById('timelineChart').getContext('2d');
|
||||||
chart2 = new Chart(ctx2, {
|
chart2 = new Chart(ctx2, {
|
||||||
type: 'bar',
|
type: 'bar',
|
||||||
|
|||||||
@@ -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; }
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user