OSDN Git Service

Merge branch 'v06' of git.sourceforge.jp:/gitroot/pettanr/pettanr into v06
[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     @load()\r
7   \r
8   load: () ->\r
9     @picture = @item.picture()\r
10     @picture.fetch({cache: true}).done =>\r
11       @credit = @picture.credit_view(false)\r
12       panel = @item.panel()\r
13       panel.fetch({cache: true}).done =>\r
14         @panel_icon = new Pettanr.Views.Common.Icon({item: panel, half: true})\r
15         @listenTo(@panel_icon, 'click', @panel_click)\r
16         @trigger('ready')\r
17   \r
18   render: () ->\r
19     this.$el.html('')\r
20     this.$el.append(@credit.render().el)\r
21     this.$el.append(@panel_icon.render().el)\r
22     this\r
23   \r
24   panel_click: () ->\r
25     @trigger('http_get', @panel_icon.url())\r
26   \r