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 692306c..bb611db 100644 (file)
@@ -2,22 +2,21 @@ class Locmare.FilerModule.BodyModule.FileBodyModule.FileItemModule.SymbolItemCol
   \r
   initialize: (options) ->\r
     super(options)\r
-  \r
-  template_file_name: () ->\r
-    'picture'\r
-  \r
-  method_name: () ->\r
-    @my_manifest.method_name()\r
-  \r
-  url: () ->\r
-    if @item.methods(true).is_include(@method_name())\r
+    if @item[@method_name()]\r
       @item[@method_name()]()\r
-    else\r
-      '/images/error.png'\r
   \r
-  tag_opt: () ->\r
-    if @item.methods(true).is_include(@method_name())\r
-      @item[@method_name()]()\r
+  render: () ->\r
+    if @item.symbol_picture\r
+      this.$el.html(@item.symbol_picture.render().el)\r
     else\r
-      {'src': '/images/error.png', 'width': Manifest.manifest().magic_numbers['thumbnail_width'], 'height': Manifest.manifest().magic_numbers['thumbnail_height']}\r
+      picture = new Pettanr.Image.SymbolImg({\r
+        attr: {\r
+          src: '/images/error.png'\r
+        }\r
+      })\r
+      this.$el.html(picture.render().el)\r
+    this\r
+  \r
+  method_name: () ->\r
+    @my_manifest.method_name\r
   \r