From b0238ad57fbc59bdb44d62ce70f63deec0276eca Mon Sep 17 00:00:00 2001 From: Senad Uka Date: Thu, 19 May 2016 16:57:16 +0200 Subject: [PATCH] Fixed small output bug --- README.md | 3 +-- index.html | 19 +++++++++++++++---- 2 files changed, 16 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 1dda464..6462ccb 100644 --- a/README.md +++ b/README.md @@ -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# diff --git a/index.html b/index.html index c68939e..f1d3325 100644 --- a/index.html +++ b/index.html @@ -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(); };