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,7 +5,6 @@ Estimates are written somwhere inside Description field in the form of:
`Estimate: X` where X can be any whole number. `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. 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: You can use it here:
https://dl.dropboxusercontent.com/u/11716687/web/trello-estimates/index.html# https://dl.dropboxusercontent.com/u/11716687/web/trello-estimates/index.html#

View File

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