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 fc35293..618a8a1 100644 (file)
@@ -1,5 +1,23 @@
 class Locmare.FilerModule.BodyModule.FileBodyModule.FileItemModule.CaptionItemColumnModule.DefaultModule.LinkModule.ActionLink extends Locmare.FilerModule.BodyModule.FileBodyModule.FileItemModule.CaptionItemColumnModule.DefaultModule.LinkModule.BaseLink\r
   \r
+  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