From a5d7f0d74147a6d80e85bc2e088de80fa883b907 Mon Sep 17 00:00:00 2001 From: Francis Irving Date: Tue, 11 Jun 2013 10:32:59 +0000 Subject: [PATCH] Show images set based on non-null values --- http/facts.js | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/http/facts.js b/http/facts.js index 30eea4f..8f2bb36 100644 --- a/http/facts.js +++ b/http/facts.js @@ -431,15 +431,19 @@ var fact_numbers_range = function(col, group) { var fact_image_collage = function(col, group) { // See if we have enough images var image_count = 0 + var non_null_count = 0 $.each(group, function(ix, value) { - if (is_image_url(String(value.val))) { - image_count ++ + if (value.val != null) { + non_null_count ++ + if (is_image_url(String(value.val))) { + image_count ++ + } } }) if (image_count < 1) { return } - if (image_count < 4 && image_count != group.length) { + if (image_count < 4 && image_count != non_null_count) { return }