src/js/widgets/polemicWidget.js
branchpopcorn-port
changeset 567 ada550479aaf
parent 566 098929cd2d62
child 595 29d86e6c61a6
--- a/src/js/widgets/polemicWidget.js	Tue Jan 03 12:05:46 2012 +0100
+++ b/src/js/widgets/polemicWidget.js	Tue Jan 03 12:25:57 2012 +0100
@@ -294,6 +294,11 @@
                     this.yMax = y;
                   }
                   
+                  /* some tweets seem to be duplicated - so we make a check before
+                     creating a new rect */
+                  if (this.svgElements.hasOwnProperty(frames[i].mytweetsID[k].cinecast_id))
+                    continue;
+                  
                   var e = this.paper.rect(x, y, frameSize - margin, TweetHeight /* height */)
                                     .attr({stroke:"#00","stroke-width":0.1,  fill: colors[j]});  
                   
@@ -303,7 +308,7 @@
                   e.time = frames[i].mytweetsID[k].timeframe;
                   e.title = frames[i].mytweetsID[k].title;
                   e.id = frames[i].mytweetsID[k].cinecast_id;
-
+                  
                   this.svgElements[e.id] = e;
                   
                   IriSP.jQuery(e.node).mouseenter(function(element) { return function (event) {                        
@@ -388,7 +393,7 @@
   // decrease the opacity of the other elements.
   for (var id in this.svgElements) {
     var e = this.svgElements[id];
-    e.attr({fill: e.color, opacity: 0.4});
+    e.attr({fill: e.color, opacity: 0.4});   
   }