OSDN Git Service

0956877a4699a732fa15d08715ecbe106e698e58
[pettanr/pettanr.git] / app / assets / javascripts / view / summary / binder.js.coffee
1 class Pettanr.View.Summary.Binder extends Pettanr.View.Summary\r
2   \r
3   initialize: (options) ->\r
4     super(options)\r
5     @visible_t = options.visible_t\r
6     @visible_column_name = options.visible_column_name\r
7   \r
8   render: () ->\r
9     super()\r
10     @visible = new Tag.Div({\r
11       content: Pettanr.AppHelper.t_selected_item(@visible_t, @item.get(@visible_column_name))\r
12     })\r
13     @item.get_parent('author', this, {\r
14       success: (@author) =>\r
15         @author_mini_faced_label = @author.mini_faced_label({\r
16           context: @context,\r
17           click: () =>\r
18             @trigger('http_get', @author.show_url())\r
19         })\r
20         this.$el.html('')\r
21         this.$el.append(@visible.render().el)\r
22         this.$el.append(@author_mini_faced_label.render().el)\r
23     })\r
24     this\r
25   \r