src/js/widgets/annotationsListWidget.js
branchpopcorn-port
changeset 599 a5a5e70d46a7
parent 595 29d86e6c61a6
child 602 b35862f9b0b0
equal deleted inserted replaced
598:50cfc3600365 599:a5a5e70d46a7
     9 };
     9 };
    10 
    10 
    11 IriSP.AnnotationsListWidget.prototype.clearWidget = function() {
    11 IriSP.AnnotationsListWidget.prototype.clearWidget = function() {
    12 };
    12 };
    13 
    13 
    14 IriSP.AnnotationsListWidget.prototype.draw = function() {
    14 /** draw the annotation list */
       
    15 IriSP.AnnotationsListWidget.prototype.drawList = function() {
    15   var _this = this;
    16   var _this = this;
    16 
    17 
    17   var view_type = this._serializer.getContributions();
    18   var view_type = this._serializer.getContributions();
    18   var annotations = this._serializer._data.annotations;
    19   var annotations = this._serializer._data.annotations;
    19   var list = [];
    20   var list = [];
    43 
    44 
    44     list.push(obj);
    45     list.push(obj);
    45   }
    46   }
    46 
    47 
    47   var widgetMarkup = IriSP.templToHTML(IriSP.annotationsListWidget_template, {annotations: list});
    48   var widgetMarkup = IriSP.templToHTML(IriSP.annotationsListWidget_template, {annotations: list});
    48   this.selector.append(widgetMarkup);
    49   this.selector.html(widgetMarkup);
    49 };
    50 };
       
    51 
       
    52 IriSP.AnnotationsListWidget.prototype.draw = function() {
       
    53 
       
    54   this.drawList();
       
    55   this._Popcorn.listen("IriSP.createAnnotationWidget.addedAnnotation", IriSP.wrap(this, this.redraw));
       
    56 };
       
    57 
       
    58 IriSP.AnnotationsListWidget.prototype.redraw = function() {
       
    59   this.drawList();
       
    60 };