src/widgets/MultiSegments.js
changeset 1021 7253d4d06f0d
parent 1013 392ddcd212d7
child 1024 894079bece86
equal deleted inserted replaced
1018:de1e7cf6bfc4 1021:7253d4d06f0d
     4 
     4 
     5 IriSP.Widgets.MultiSegments.prototype = new IriSP.Widgets.Widget();
     5 IriSP.Widgets.MultiSegments.prototype = new IriSP.Widgets.Widget();
     6 
     6 
     7 IriSP.Widgets.MultiSegments.prototype.defaults = {
     7 IriSP.Widgets.MultiSegments.prototype.defaults = {
     8     annotation_show_arrow: true,
     8     annotation_show_arrow: true,
     9     annotation_start_minimized: true,
     9     annotation_start_minimized: false,
    10     annotation_show_annotation_type: true,
    10     annotation_show_annotation_type: true,
    11     show_all: false
    11     show_all: false
    12 };
    12 };
    13 
    13 
    14 IriSP.Widgets.MultiSegments.prototype.draw = function() {
    14 IriSP.Widgets.MultiSegments.prototype.draw = function() {
    94             );
    94             );
    95             
    95             
    96             lines.push(line);
    96             lines.push(line);
    97         }
    97         }
    98     });
    98     });
    99     var _annotationWidgets = _this.$.find(".Ldt-MultiSegments-Annotation");
    99     
       
   100     // open line on segment click
       
   101     $j(document).on("click",".Ldt-Segments-Segment",function(e){
       
   102     	if (!_this.show_all && currentLine && !currentLine.hasSegmentsNow()) {
       
   103             currentLine = undefined;
       
   104         }
       
   105         IriSP._(lines).each(function(line) {
       
   106         	if($j(e.target).parent().parent()[0]==line.segmentWidget[0]){
       
   107         		currentLine = line;
       
   108         		line.show();
       
   109         	} else {
       
   110                 line.hide();
       
   111             }
       
   112         });
       
   113     });
       
   114     
       
   115     //var _annotationWidgets = _this.$.find(".Ldt-MultiSegments-Annotation");
   100     
   116     
   101     function checkVisibilities(_time) {
   117     function checkVisibilities(_time) {
   102         if (!_this.show_all && currentLine && !currentLine.hasSegmentsNow()) {
   118         /*if (!_this.show_all && currentLine && !currentLine.hasSegmentsNow()) {
   103             currentLine = undefined;
   119             currentLine = undefined;
   104         }
   120         }
   105         IriSP._(lines).each(function(line) {
   121         IriSP._(lines).each(function(line) {
   106             if (line.hasSegmentsNow()) {
   122             if (line.hasSegmentsNow()) {
   107                 if (!_this.show_all && !currentLine) {
   123                 if (!_this.show_all && !currentLine) {
   113                     line.hide();
   129                     line.hide();
   114                 }
   130                 }
   115             } else {
   131             } else {
   116                 line.hide();
   132                 line.hide();
   117             }
   133             }
   118         });
   134         });*/
   119     }
   135     }
   120     
       
   121     this.onMediaEvent("timeupdate", checkVisibilities);
       
   122 };
   136 };