src/js/widgets.js
changeset 982 cfcbac34d020
parent 965 eadb7290c325
child 984 e034099276f6
equal deleted inserted replaced
981:982d2226771c 982:cfcbac34d020
   119 IriSP.Widgets.Widget.prototype.onMediaEvent = function(_eventName, _functionOrName) {
   119 IriSP.Widgets.Widget.prototype.onMediaEvent = function(_eventName, _functionOrName) {
   120     this.media.on(_eventName, this.getFunctionOrName(_functionOrName));
   120     this.media.on(_eventName, this.getFunctionOrName(_functionOrName));
   121 }
   121 }
   122 
   122 
   123 IriSP.Widgets.Widget.prototype.getWidgetAnnotations = function() {
   123 IriSP.Widgets.Widget.prototype.getWidgetAnnotations = function() {
   124     return typeof this.annotation_type !== "undefined" && this.annotation_type ? this.media.getAnnotationsByTypeTitle(this.annotation_type) : this.media.getAnnotations();
   124     if (typeof this.annotation_type === "undefined") {
       
   125         return this.media.getAnnotations();
       
   126     }
       
   127     if (this.annotation_type.elementType === "annotationType") {
       
   128         return this.annotation_type.getAnnotations();
       
   129     }
       
   130     return this.media.getAnnotationsByTypeTitle(this.annotation_type);
   125 }
   131 }
   126 
   132 
   127 IriSP.Widgets.Widget.prototype.getWidgetAnnotationsAtTime = function() {
   133 IriSP.Widgets.Widget.prototype.getWidgetAnnotationsAtTime = function() {
   128     var _time = this.media.getCurrentTime();
   134     var _time = this.media.getCurrentTime();
   129     return this.getWidgetAnnotations().filter(function(_annotation) {
   135     return this.getWidgetAnnotations().filter(function(_annotation) {