src/widgets/MediaList.js
changeset 965 eadb7290c325
parent 957 4da0a5740b6c
child 982 cfcbac34d020
--- a/src/widgets/MediaList.js	Fri Sep 21 11:18:57 2012 +0900
+++ b/src/widgets/MediaList.js	Mon Sep 24 18:32:22 2012 +0200
@@ -57,9 +57,16 @@
 }
 
 IriSP.Widgets.MediaList.prototype.draw = function() {
-    this.onMediaEvent("timeupdate","onTimeupdate");
     this.$.addClass("Ldt-MediaListWidget")
     this.renderTemplate();
+    var _this = this;
+    if (typeof this.media.getMedias === "function") {
+        this.media.getMedias().forEach(function(_m) {
+            _m.on("enter", function() {
+                _this.redraw(_m);
+            });
+        })
+    }
     this.redraw();
 };
 
@@ -123,14 +130,3 @@
         this.$.find('.Ldt-MediaList-Other').hide();
     }
 };
-
-IriSP.Widgets.MediaList.prototype.onTimeupdate = function(_time) {
-    var _media = this.source.currentMedia;
-    if (_media.elementType === "mashup") {
-        _media = _media.getMediaAtTime(_time);
-    }
-    if (typeof _media !== "undefined" && _media.id !== this.lastMedia) {
-        this.lastMedia = _media.id;
-        this.redraw(_media);
-    }
-}