mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-10-03 03:00:14 +00:00
Fix #1860
This commit is contained in:
22
public/v1/js/ff/index.js
vendored
22
public/v1/js/ff/index.js
vendored
@@ -113,9 +113,23 @@ function getBalanceBox() {
|
||||
// do not use "sums", only use list.
|
||||
$('#box-balance-progress').remove();
|
||||
var expense, string, sum, income, current;
|
||||
|
||||
// first loop, echo only "preferred".
|
||||
for (x in data.sums) {
|
||||
current = $('#box-balance-list').html();
|
||||
sum = data.sums[x];
|
||||
expense = data.expenses[x];
|
||||
income = data.incomes[x];
|
||||
string = income + ' / ' + expense + ': ' + sum;
|
||||
if (data.preferred == x) {
|
||||
$('#box-balance-list').html(current + '<span title="' + string + '">' + string + '</span>' + '<br>');
|
||||
}
|
||||
}
|
||||
// then list the others (only 1 space)
|
||||
|
||||
var count = 0;
|
||||
for (x in data.sums) {
|
||||
if (count > 1) {
|
||||
if (count > 2) {
|
||||
return;
|
||||
}
|
||||
current = $('#box-balance-list').html();
|
||||
@@ -123,9 +137,11 @@ function getBalanceBox() {
|
||||
expense = data.expenses[x];
|
||||
income = data.incomes[x];
|
||||
string = income + ' / ' + expense + ': ' + sum;
|
||||
|
||||
$('#box-balance-list').html(current + '<span title="' + string + '">' + string + '</span>' + '<br>');
|
||||
if (data.preferred != x) {
|
||||
$('#box-balance-list').html(current + '<span title="' + string + '">' + string + '</span>' + '<br>');
|
||||
}
|
||||
count++;
|
||||
|
||||
}
|
||||
});
|
||||
}
|
Reference in New Issue
Block a user