debug timeline 0018154
authorcavaliet
Mon, 18 Nov 2013 15:07:49 +0100
changeset 190 6d3bf30a171b
parent 189 577421d64334
child 191 d6c92b37252f
debug timeline 0018154
src/jocondelab/static/jocondelab/js/front-timeline.js
--- a/src/jocondelab/static/jocondelab/js/front-timeline.js	Mon Nov 18 14:16:09 2013 +0100
+++ b/src/jocondelab/static/jocondelab/js/front-timeline.js	Mon Nov 18 15:07:49 2013 +0100
@@ -240,13 +240,13 @@
         /* Now displaying the different terms that we will show on the timeline */
         var html = _(tlCache).chain()
             .filter(function(item) { // Only show those within the range
-                return (item.end_year >= fromYear && item.start_year <= toYear && item.label);
+                return (item.end_year > fromYear && item.start_year < toYear && item.label);
             }).first(itemCount) // Take the first 12
             .sortBy(function(item) { // Sort by mean year
                 return (item.start_year + item.end_year);
             }).map(function(item) { // Render them as HTML
-                var l = Math.min(cWidth, Math.max(0, yrToX(item.start_year))),
-                    r = Math.min(cWidth, Math.max(0, yrToX(item.end_year + 1)));
+                var l = Math.min(cWidth, Math.max(0, yrToX(Math.max(item.start_year, fromYear)))),
+                    r = Math.min(cWidth, Math.max(0, yrToX(Math.min(item.end_year, toYear) + 1)));
                 return itemTpl({
                     current: (item.dbpedia_uri == currentTerm),
                     dbpedia_uri: item.dbpedia_uri,