From 698f6dfe05d83bd94fed98f4f4fdbb0d9dbfb439 Mon Sep 17 00:00:00 2001 From: i107760 <13422-i107760@users.noreply.gitgud.io> Date: Fri, 27 Mar 2020 22:48:13 +0100 Subject: [PATCH] Temporary way to make displayed totals gray --- src/uncategorized/costsBudget.js | 27 ++++++++++++++++----------- 1 file changed, 16 insertions(+), 11 deletions(-) diff --git a/src/uncategorized/costsBudget.js b/src/uncategorized/costsBudget.js index 933341ccb45..d2b977ec523 100644 --- a/src/uncategorized/costsBudget.js +++ b/src/uncategorized/costsBudget.js @@ -871,27 +871,32 @@ App.UI.Budget.Cost = function() { headline.textContent = title; cell.append(headline); cell = row.insertCell(); - cell.append(cashFormatColorDOM(F[group].income)); + cell.append(cashFormatColorDOM(F[group].income, null, true)); cell = row.insertCell(); - cell.append(cashFormatColorDOM(F[group].expenses)); + cell.append(cashFormatColorDOM(F[group].expenses, null, true)); cell = row.insertCell(); - cell.append(cashFormatColorDOM(F[group].profits)); + cell.append(cashFormatColorDOM(F[group].profits, null, true)); } } - function cashFormatColorDOM(s, invert = false) { + function cashFormatColorDOM(s, invert = false, temp) { if (invert) { s = -1 * s; } let el = document.createElement('span'); el.textContent = cashFormat(s); - // Display red if the value is negative, unless invert is true - if (s < 0) { - el.className = "red"; - // Yellow for positive - } else if (s > 0) { - el.className = "yellowgreen"; - // White for exactly zero + if (temp === true) { + // Gray display for totals when expanded + el.className = "gray"; + } else { + // Display red if the value is negative, unless invert is true + if (s < 0) { + el.className = "red"; + // Yellow for positive + } else if (s > 0) { + el.className = "yellowgreen"; + // White for exactly zero + } } return el; } -- GitLab