Skip to content
Snippets Groups Projects
Commit 698f6dfe authored by i107760's avatar i107760
Browse files

Temporary way to make displayed totals gray

parent a4000b52
No related branches found
No related tags found
1 merge request!6433Reworking: `economyJS.js` to track and subtract slave upkeep per assignment, `costsBudget.js` to display more details and redo the ordering of displayed stats
......@@ -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;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment