OSDN Git Service

fix: fetch fail
[pettanr/pettanr.git] / app / assets / javascripts / views / ground_pictures / summary.js.coffee
index 0ce9dbb..c858b3d 100644 (file)
@@ -2,24 +2,23 @@ class Pettanr.Views.GroundPicture.Summary extends Pettanr.View.Summary
   \r
   initialize: (options) ->\r
     super(options)\r
-    @item = options.item\r
+  \r
+  render: () ->\r
+    super()\r
     @item.get_parent('picture', this, {\r
       success: (@picture) =>\r
-        @credit = new Pettanr.View.Credit(@picture, {})\r
+        @credit = new Pettanr.View.Credit(@picture, {icon: false})\r
         @item.get_parent('panel', this, {\r
           success: (@panel) =>\r
-            @panel_icon = new Pettanr.Views.Common.Icon({item: @panel, half: true})\r
-            @listenTo(@panel_icon, 'click', @panel_click)\r
-            @trigger('ready')\r
+            @panel_face_button = @panel.mini_face_button({\r
+              context: this, \r
+              click: () =>\r
+                @trigger('http_get', @panel.show_url())\r
+            })\r
+            this.$el.html('')\r
+            this.$el.append(@credit.render().el)\r
+            this.$el.append(@panel_face_button.render().el)\r
         })\r
     })\r
-  \r
-  render: () ->\r
-    this.$el.html('')\r
-    this.$el.append(@credit.render().el)\r
-    this.$el.append(@panel_icon.render().el)\r
     this\r
   \r
-  panel_click: () ->\r
-    @trigger('http_get', @panel_icon.url())\r
-  \r