web/res/metadataplayer/MultiSegments.js
changeset 1198 ff4b567d51f2
parent 955 5171f8825985
child 1304 10974bff4dae
--- a/web/res/metadataplayer/MultiSegments.js	Fri Feb 13 13:14:15 2015 +0100
+++ b/web/res/metadataplayer/MultiSegments.js	Sun Feb 15 00:43:16 2015 +0100
@@ -6,7 +6,7 @@
 
 IriSP.Widgets.MultiSegments.prototype.defaults = {
     annotation_show_arrow: true,
-    annotation_start_minimized: true,
+    annotation_start_minimized: false,
     annotation_show_annotation_type: true,
     show_all: false
 };
@@ -96,10 +96,26 @@
             lines.push(line);
         }
     });
-    var _annotationWidgets = _this.$.find(".Ldt-MultiSegments-Annotation");
+    
+    // open line on segment click
+    IriSP.jQuery(document).on("click",".Ldt-Segments-Segment",function(e){
+    	if (!_this.show_all && currentLine && !currentLine.hasSegmentsNow()) {
+            currentLine = undefined;
+        }
+        IriSP._(lines).each(function(line) {
+        	if(IriSP.jQuery(e.target).parent().parent()[0]==line.segmentWidget[0]){
+        		currentLine = line;
+        		line.show();
+        	} else {
+                line.hide();
+            }
+        });
+    });
+    
+    //var _annotationWidgets = _this.$.find(".Ldt-MultiSegments-Annotation");
     
     function checkVisibilities(_time) {
-        if (!_this.show_all && currentLine && !currentLine.hasSegmentsNow()) {
+        /*if (!_this.show_all && currentLine && !currentLine.hasSegmentsNow()) {
             currentLine = undefined;
         }
         IriSP._(lines).each(function(line) {
@@ -115,8 +131,6 @@
             } else {
                 line.hide();
             }
-        });
+        });*/
     }
-    
-    this.onMediaEvent("timeupdate", checkVisibilities);
-};
\ No newline at end of file
+};