OSDN Git Service

add load icon
[pettanr/pettanr.git] / app / assets / javascripts / locmare / filer / body / file_body / file_item / symbol / default / face / picture.js.coffee
index 10802e1..bb611db 100644 (file)
@@ -2,23 +2,19 @@ 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
+      @item[@method_name()]()\r
+  \r
+  render: () ->\r
+    if @item.symbol_picture\r
+      this.$el.html(@item.symbol_picture.render().el)\r
     else\r
-      @picture = new Pettanr.Image.SymbolImg({\r
+      picture = new Pettanr.Image.SymbolImg({\r
         attr: {\r
           src: '/images/error.png'\r
         }\r
       })\r
-      _this.render()\r
-  \r
-  render: () ->\r
-    if @picture\r
-      this.$el.html(@picture.render().el)\r
+      this.$el.html(picture.render().el)\r
     this\r
   \r
   method_name: () ->\r