Fixed small output bug

This commit is contained in:
Senad Uka
2016-05-19 16:57:16 +02:00
parent 566e70f99d
commit b0238ad57f
2 changed files with 16 additions and 6 deletions

View File

@@ -102,21 +102,32 @@
return hours;
}
var printOutValues = function() {
$.each(values.labels, function(labelId, value) {
$("#label_" + labelId).html("" + value + "h");
});
$.each(values.lists, function(listId, value) {
$("#list_" + listId).html("" + value + "h");
});
};
var loadedCards = function(cards) {
if (!cards) return;
$.each(cards, function(index, card) {
var hours = getHours(card.desc);
values.lists[card.idList] += hours;
$("#list_" + card.idList).html("" + values.lists[card.idList] + "h");
if (!card.idLabels) return true;
$.each(card.idLabels, function(_index, labelId) {
values.labels[labelId] += hours;
$("#label_" + labelId).html("" + values.labels[labelId] + "h");
});
});
printOutValues();
};