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

@@ -5,8 +5,7 @@ Estimates are written somwhere inside Description field in the form of:
`Estimate: X` where X can be any whole number.
Estimates are summed by label and by list and total number of hours is colorfully written in front of the label list name.
`?` instead of number of hours marks those labels that don't have any cards with estimates entered.
You can use it here:
https://dl.dropboxusercontent.com/u/11716687/web/trello-estimates/index.html#

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();
};