Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
fc-pregmod
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
pregmodfan
fc-pregmod
Commits
698f6dfe
Commit
698f6dfe
authored
5 years ago
by
i107760
Browse files
Options
Downloads
Patches
Plain Diff
Temporary way to make displayed totals gray
parent
a4000b52
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!6433
Reworking: `economyJS.js` to track and subtract slave upkeep per assignment, `costsBudget.js` to display more details and redo the ordering of displayed stats
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/uncategorized/costsBudget.js
+16
-11
16 additions, 11 deletions
src/uncategorized/costsBudget.js
with
16 additions
and
11 deletions
src/uncategorized/costsBudget.js
+
16
−
11
View file @
698f6dfe
...
...
@@ -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
;
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment