web/res/metadataplayer/Tagcloud.js
changeset 719 d0d3a9369f84
parent 694 e9400c80e1e4
child 955 5171f8825985
--- a/web/res/metadataplayer/Tagcloud.js	Thu Nov 15 13:12:29 2012 +0100
+++ b/web/res/metadataplayer/Tagcloud.js	Wed Nov 28 13:19:48 2012 +0100
@@ -39,9 +39,6 @@
 }
 
 IriSP.Widgets.Tagcloud.prototype.draw = function() {
-    this.onMdpEvent("search", "onSearch");
-    this.onMdpEvent("search.closed", "onSearch");
-    this.onMdpEvent("search.cleared", "onSearch");
     
     if (this.segment_annotation_type) {
         var _this = this;
@@ -108,9 +105,10 @@
     this.$.html(Mustache.to_html(this.template,  {words: _words }));
     this.$.find(".Ldt-Tagcloud-item").click(function() {
         var _txt = IriSP.jQuery(this).attr("content");
-        _this.player.trigger("search.triggeredSearch", _txt);
+        _this.source.getAnnotations().search(_txt);
     });
-    
+    this.source.getAnnotations().on("search", this.functionWrapper("onSearch"));
+    this.source.getAnnotations().on("search-cleared", this.functionWrapper("onSearch"));
 }
 
 IriSP.Widgets.Tagcloud.prototype.onSearch = function(searchString) {