OSDN Git Service

fix summary
[pettanr/pettanr.git] / app / assets / javascripts / views / speech_balloons / summary.js.coffee
1 class Pettanr.Views.SpeechBalloon.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     panel = @item.panel()\r
10     panel.fetch({cache: true}).done =>\r
11       @panel_icon = new Pettanr.Views.Common.Icon({item: panel, half: true})\r
12       author = panel.author()\r
13       author.fetch({cache: true}).done =>\r
14         @author_icon_with_caption = author.icon_with_caption_view(true, 'name', 12)\r
15         @trigger('ready')\r
16   \r
17   render: () ->\r
18     this.$el.html('')\r
19     this.$el.append(@panel_icon.render().el)\r
20     this.$el.append(@author_icon_with_caption.render().el)\r
21     this\r
22   \r