src/widgets/Polemic.js
changeset 1012 7e18d953a1f8
parent 1004 cf0f2339169e
child 1017 b6e39f6fd24f
--- a/src/widgets/Polemic.js	Thu Sep 05 12:53:58 2013 +0200
+++ b/src/widgets/Polemic.js	Mon Sep 30 14:39:34 2013 +0200
@@ -15,7 +15,8 @@
         _to_: " to ",
         _annotations: " annotation(s)"
     }
-}
+};
+
 IriSP.Widgets.Polemic.prototype.defaults = {
     element_width : 5,
     element_height : 5,
@@ -70,7 +71,9 @@
         _slice_count = Math.floor( this.width / this.element_width ),
         _duration = this.source.getDuration(),
         _max = 0,
-        _list = this.getWidgetAnnotations(),
+        _list = this.getWidgetAnnotations().filter(function(_a) {
+            return !_a.getDuration().milliseconds;
+        }),
         _this = this;
     
     for (var _i = 0; _i < _slice_count; _i++) {
@@ -84,7 +87,7 @@
                     return _annotation.begin >= _begin && _annotation.begin < _end;
                 }),
                 polemicStacks : []
-            }
+            };
             
         for (var _j = 0; _j < this.polemics.length; _j++) {
             var _polemic = _res.annotations.searchByDescription(this.polemics[_j].keywords);
@@ -252,7 +255,7 @@
         IriSP._(_slices).forEach(function(_slice) {
             var _y = _this.height,
                 _nums = _slice.annotations.length + "," + IriSP._(_slice.polemicStacks).map(function(_annotations) {
-                    return _annotations.length
+                    return _annotations.length;
                 }).join(",");
             if (_slice.annotations.length) {
                 var _h = Math.ceil(_scale * _slice.annotations.length);
@@ -282,7 +285,7 @@
                     _html = '<p>' + _this.l10n.from_ + _el.attr("begin-time") + _this.l10n._to_ + _el.attr("end-time") + '</p>';
                 for (var _i = 0; _i <= _this.polemics.length; _i++) {
                     var _color = _i ? _this.polemics[_i - 1].color : _this.defaultcolor;
-                    _html += '<div class="Ldt-Tooltip-AltColor" style="background: ' + _color + '"></div><p>' + _nums[_i] + _this.l10n._annotations + '</p>'
+                    _html += '<div class="Ldt-Tooltip-AltColor" style="background: ' + _color + '"></div><p>' + _nums[_i] + _this.l10n._annotations + '</p>';
                 }
                 if (_this.tooltip) {
                     _this.tooltip.show(+ _el.attr("pos-x"), + _el.attr("pos-y"), _html);
@@ -292,9 +295,9 @@
                 if (_this.tooltip) {
                     _this.tooltip.hide();
                 }
-            })
+            });
             
-    }
+    };
     
     this.$position = IriSP.jQuery('<div>').addClass("Ldt-Polemic-Position");
         
@@ -316,7 +319,7 @@
         },
         "tooltip"
     );
-}
+};
 
 IriSP.Widgets.Polemic.prototype.onTimeupdate = function(_time) {
     var _x = Math.floor( this.width * _time / this.media.duration);
@@ -325,5 +328,5 @@
     });
     this.$position.css({
         left: _x + "px"
-    })
-}
+    });
+};