OSDN Git Service

fix:asoc system
[pettanr/pettanr.git] / app / assets / javascripts / views / speeches / summary.js.coffee
1 class Pettanr.Views.Speech.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('speech_balloon', this, {\r
7       success: (@speech_balloon) =>\r
8         @speech_balloon.get_parent('panel', this, {\r
9           success: (@panel) =>\r
10             @panel_icon = new Pettanr.Views.Common.Icon({item: @panel, half: true})\r
11             @listenTo(@panel_icon, 'click', @panel_click)\r
12             @panel.get_parent('author', this, {\r
13               success: (@author) =>\r
14                 @author_icon_with_caption = @author.icon_with_caption_view(true, 'name', 12)\r
15                 @listenTo(@author_icon_with_caption, 'click', @author_click)\r
16                 @trigger('ready')\r
17             })\r
18         })\r
19     })\r
20   \r
21   render: () ->\r
22     this.$el.html('')\r
23     this.$el.append(@panel_icon.render().el)\r
24     this.$el.append(@author_icon_with_caption.render().el)\r
25     this\r
26   \r
27   panel_click: () ->\r
28     @trigger('http_get', @panel_icon.url())\r
29   \r
30   author_click: () ->\r
31     @trigger('http_get', @author_icon_with_caption.url())\r
32   \r