OSDN Git Service

Merge branch 'v06' of git.sourceforge.jp:/gitroot/pettanr/pettanr into v06
[pettanr/pettanr.git] / app / assets / javascripts / locmare / filer / body / file_body / file_item / symbol / default / face / picture.js.coffee
index 692306c..11f6397 100644 (file)
@@ -2,22 +2,20 @@ class Locmare.FilerModule.BodyModule.FileBodyModule.FileItemModule.SymbolItemCol
   \r
   initialize: (options) ->\r
     super(options)\r
+    _this = this\r
+    if i = @item[@method_name()]()\r
+      i.fetch().done ->\r
+        _this.picture = new Pettanr.AppHelperImg({src: i.r_url(), size: _this.icon_size()})\r
+        _this.render()\r
+    else\r
+      @picture = new Pettanr.AppHelperImg({src: '/images/error.png', size: @icon_size()})\r
+      _this.render()\r
   \r
-  template_file_name: () ->\r
-    'picture'\r
+  render: () ->\r
+    if @picture\r
+      this.$el.html(@picture.render().el)\r
+    this\r
   \r
   method_name: () ->\r
-    @my_manifest.method_name()\r
-  \r
-  url: () ->\r
-    if @item.methods(true).is_include(@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
-    else\r
-      {'src': '/images/error.png', 'width': Manifest.manifest().magic_numbers['thumbnail_width'], 'height': Manifest.manifest().magic_numbers['thumbnail_height']}\r
+    @my_manifest.method_name\r
   \r