Fix: referral column visibility now respects checkbox, not just numPeople
- The second toggle block (lines 1718-1725) was overriding the checkbox state - When numPeople > 0, it was showing sponsor columns regardless of checkbox - Now uses so both conditions must be met - Referral columns stay hidden by default even when simulating a referral plan
This commit is contained in:
+4
-3
@@ -1715,13 +1715,14 @@ ${numPeople > 0 ? `
|
|||||||
`;
|
`;
|
||||||
document.getElementById('summaryCards').innerHTML = summaryHtml;
|
document.getElementById('summaryCards').innerHTML = summaryHtml;
|
||||||
|
|
||||||
// Toggle referral columns when no people in downline
|
// Toggle referral columns when no people in downline, but respect checkbox
|
||||||
|
const shouldShow = (numPeople > 0) && showRef;
|
||||||
for (const id of ['headerYourCut','headerCumulative','headerTimelineComm','headerTimelineCum']) {
|
for (const id of ['headerYourCut','headerCumulative','headerTimelineComm','headerTimelineCum']) {
|
||||||
const el = document.getElementById(id);
|
const el = document.getElementById(id);
|
||||||
if (el) el.style.display = numPeople > 0 ? '' : 'none';
|
if (el) el.style.display = shouldShow ? '' : 'none';
|
||||||
}
|
}
|
||||||
for (const el of document.querySelectorAll('.referral-col')) {
|
for (const el of document.querySelectorAll('.referral-col')) {
|
||||||
el.style.display = numPeople > 0 ? '' : 'none';
|
el.style.display = shouldShow ? '' : 'none';
|
||||||
}
|
}
|
||||||
|
|
||||||
let cumRunning = 0;
|
let cumRunning = 0;
|
||||||
|
|||||||
Reference in New Issue
Block a user