OSDN Git Service

fix:retrive
[pettanr/pettanr.git] / app / assets / javascripts / views / ground_pictures / summary.js.coffee
1 class Pettanr.Views.GroundPicture.Summary extends Pettanr.Views.Common.Summary\r
2   \r
3   initialize: (options) ->\r
4     super(options)\r
5     @item = options.item\r
6     @item.get_parent('picture', this, {\r
7       success: (@picture) =>\r
8         @credit = @picture.credit_view(false)\r
9         @item.get_parent('panel', this, {\r
10           success: (@panel) =>\r
11             @panel_icon = new Pettanr.Views.Common.Icon({item: @panel, half: true})\r
12             @listenTo(@panel_icon, 'click', @panel_click)\r
13             @trigger('ready')\r
14         })\r
15     })\r
16   \r
17   render: () ->\r
18     this.$el.html('')\r
19     this.$el.append(@credit.render().el)\r
20     this.$el.append(@panel_icon.render().el)\r
21     this\r
22   \r
23   panel_click: () ->\r
24     @trigger('http_get', @panel_icon.url())\r
25   \r