OSDN Git Service

add scroll player
[pettanr/pettanr.git] / app / assets / javascripts / locmare / filer / body / file_body / file_item / caption / default / link / action.js.coffee
index 9291220..618a8a1 100644 (file)
@@ -3,6 +3,21 @@ class Locmare.FilerModule.BodyModule.FileBodyModule.FileItemModule.CaptionItemCo
   initialize: (options) ->\r
     super(options)\r
   \r
+  render: () ->\r
+    this.$el.attr('href', @url())\r
+    # embed face everytime\r
+    this.$el.html(@default_caption.face.render().el)\r
+    this\r
+  \r
   url: () ->\r
-    @my_manifest.action_path() + @item.get('id').toString()\r
+    controller = Manifest.manifest().controllers[@item.table_name()]\r
+    action = controller.actions[@my_manifest.action_name]\r
+    mani = action.original || action\r
+    params = {\r
+      controller: controller,\r
+      action: action,\r
+      id: @item.get('id'),\r
+      format: 'html'\r
+    }\r
+    '/' + mani.url(params)\r
   \r