Report abuse

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
  var self = this;
  $(args.annotations).each(function (i,x) { 

    if ( this.type in self.annotations ) {
      self.annotations[ this.type ].push(this);
      return
    }

    self.annotations[ this.type ] = [ this ] ;

    var label = $('<label>').appendTo(div)
    .append( $('<input>', {
              type: "checkbox",
              value: this.type,
              click: function() { self.toggleAnnotationType( $(this).val() ) }
             } )
           )
    .append( this.type );
  } );