OSDN Git Service

change: cache system
[pettanr/pettanr.git] / app / assets / javascripts / locmare / filer / body / file_body / file_item / symbol / default / face / picture.js.coffee
index 10802e1..46e65bc 100644 (file)
@@ -2,25 +2,18 @@ class Locmare.FilerModule.BodyModule.FileBodyModule.FileItemModule.SymbolItemCol
   \r
   initialize: (options) ->\r
     super(options)\r
-    _this = this\r
-    if @item[@method_name()]\r
-      @item[@method_name()]((pic) ->\r
-        _this.picture = pic\r
-        _this.render()\r
-      )\r
-    else\r
-      @picture = new Pettanr.Image.SymbolImg({\r
-        attr: {\r
-          src: '/images/error.png'\r
-        }\r
-      })\r
-      _this.render()\r
   \r
+  # not render\r
+  # get symbol data and send message\r
   render: () ->\r
-    if @picture\r
-      this.$el.html(@picture.render().el)\r
+    if @item[@method_name()]\r
+      @listenTo(@item, 'ready:symbol', @ready_symbol)\r
+      @item[@method_name()]()\r
     this\r
   \r
   method_name: () ->\r
     @my_manifest.method_name\r
   \r
+  ready_symbol: (symbol) ->\r
+    @trigger('ready:symbol', symbol)\r
+  \r