src/js/widgets/segmentsWidget.js
branchpopcorn-port
changeset 303 cb091d204ba9
parent 300 a50aea26ec89
child 304 a938013fc6ea
equal deleted inserted replaced
302:c057e5134fa2 303:cb091d204ba9
    14 
    14 
    15 IriSP.SegmentsWidget.prototype.draw = function() {
    15 IriSP.SegmentsWidget.prototype.draw = function() {
    16 
    16 
    17   var self = this;
    17   var self = this;
    18   var annotations = this._serializer._data.annotations;
    18   var annotations = this._serializer._data.annotations;
    19   var view = this._serializer._data.views[0];
       
    20 
    19 
    21   /* in case we have different types of annotations, we want to display only the first type */
    20   /* in case we have different types of annotations, we want to display only the first type */
       
    21   /* the next two lines are a bit verbose because for some test data, _serializer.data.view is either
       
    22      null or undefined.
       
    23   */
       
    24   var view;
       
    25 
       
    26   if (typeof(this._serializer._data.views) !== "undefined" && this._serializer._data.views !== null)
       
    27      view = this._serializer._data.views[0];
       
    28 
    22   var view_type = "";
    29   var view_type = "";
    23 
    30 
    24   if(typeof(view.annotation_types) !== "undefined" && view.annotation_types.length > 1) {
    31   if(typeof(view) !== "undefined" && typeof(view.annotation_types) !== "undefined" && view.annotation_types.length > 1) {
    25           view_type = view.annotation_types[0];
    32           view_type = view.annotation_types[0];
    26   }
    33   }
    27  
    34  
    28   this.selector.css("overflow", "auto"); // clear the floats - FIXME : to refactor ?
    35   this.selector.css("overflow", "auto"); // clear the floats - FIXME : to refactor ?
    29   this.selector.append(Mustache.to_html(IriSP.overlay_marker_template));
    36   this.selector.append(Mustache.to_html(IriSP.overlay_marker_template));