From 77f618e332947ef151e08faa50a591e53a6f3026 Mon Sep 17 00:00:00 2001 From: echarp Date: Thu, 6 Nov 2014 15:36:25 +0100 Subject: [PATCH] Les stats vides sont prises en compte comme 0 dans les sparklines --- app/assets/javascripts/regions.js.coffee | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/app/assets/javascripts/regions.js.coffee b/app/assets/javascripts/regions.js.coffee index b96d0e2a..03c63cb8 100644 --- a/app/assets/javascripts/regions.js.coffee +++ b/app/assets/javascripts/regions.js.coffee @@ -1,9 +1,11 @@ $(document).ready -> $('table.list.dates tbody tr').each -> - vals = $(this).find('td.quantity a').map -> - val = $(this).html().replace(' ', '').trim() - if (val != '') + vals = $(this).find('td.quantity').map -> + val = $(this).find('a').html().replace(' ', '').trim() + if (val && val != '') return parseInt val + else + return 0 $(this).find('.sparkline').sparkline vals, width: '5em'