Added a no-tooltip option for Segments
authordurandn
Wed, 22 Jul 2015 16:34:04 +0200
changeset 57 03796d1f704c
parent 56 61f03beb9f39
child 58 55612a0cb009
Added a no-tooltip option for Segments
server/src/remie/static/remie/metadataplayer/Segments.js
--- a/server/src/remie/static/remie/metadataplayer/Segments.js	Wed Jul 22 16:33:38 2015 +0200
+++ b/server/src/remie/static/remie/metadataplayer/Segments.js	Wed Jul 22 16:34:04 2015 +0200
@@ -13,7 +13,8 @@
     background: "#e0e0e0",
     overlap: .25,
     found_color: "#FF00FC",
-    faded_found_color: "#ff80fc"
+    faded_found_color: "#ff80fc",
+    no_tooltip: false
 };
 
 IriSP.Widgets.Segments.prototype.template =
@@ -145,15 +146,17 @@
         background : this.background,
         margin: "1px 0"
     });
-    this.insertSubwidget(
-        this.$.find(".Ldt-Segments-Tooltip"),
-        {
-            type: "Tooltip",
-            min_x: 0,
-            max_x: this.width
-        },
-        "tooltip"
-    );
+    if (!this.no_tooltip){
+        this.insertSubwidget(
+            this.$.find(".Ldt-Segments-Tooltip"),
+            {
+                type: "Tooltip",
+                min_x: 0,
+                max_x: this.width
+            },
+            "tooltip"
+        );
+    }
     this.$segments = this.$.find('.Ldt-Segments-Segment');
     this.source.getAnnotations().on("search", function() {
         searching = true;
@@ -167,9 +170,10 @@
     });
 };
 
-IriSP.Widgets.Segments.prototype.onTimeupdate = function(_time) {
+IriSP.Widgets.Segments.prototype.onTimeupdate = function(_time) {    
     var _x = Math.floor( this.width * _time / this.media.duration);
     this.$.find('.Ldt-Segments-Position').css({
         left: _x + "px"
     });
-};
\ No newline at end of file
+};
+