OSDN Git Service

add load icon
[pettanr/pettanr.git] / app / assets / javascripts / locmare / filer / body / file_body / file_item / caption / default.js.coffee
index 12afda8..60cce29 100644 (file)
@@ -1,19 +1,24 @@
 class Locmare.FilerModule.BodyModule.FileBodyModule.FileItemModule.CaptionItemColumnModule.Default extends Locmare.FilerModule.BodyModule.FileBodyModule.FileItemModule.CaptionItemColumnModule.Base\r
-  \r
   initialize: (options) ->\r
     super(options)\r
     m = Locmare.FilerModule.BodyModule.FileBodyModule.FileItemModule.CaptionItemColumnModule.DefaultModule\r
     @face = m.FaceFactory.factory this, @my_manifest.face, @item\r
     @link = m.LinkFactory.factory this, @my_manifest.link, @item\r
   \r
-  column_template_file_name: () ->\r
-    'show'\r
-  \r
-  item_template_file_name: () ->\r
-    if @my_manifest.link.type == 'none'\r
-      'default_without_link'\r
+  render: () ->\r
+    if @has_link()\r
+      this.$el.html(@link.render().el)\r
+      @delegateEvents({'click .face': 'show'}) \r
     else\r
-      'default'\r
+      this.$el.html(@face.el)\r
+    this\r
+  \r
+  has_link: () ->\r
+    @my_manifest.link.type != 'none'\r
+  \r
+  show: () ->\r
+    window.router.navigate(@link.url(), true);\r
+    return false\r
   \r
 class Locmare.FilerModule.BodyModule.FileBodyModule.FileItemModule.CaptionItemColumnModule.DefaultModule\r
   \r