OSDN Git Service

v07
[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     this.$el.html('')\r
14     this.$el.append(@visible.render().el)\r
15     @item.get_parent('author', this, {\r
16       success: (@author) =>\r
17         @author_faced_label_button = @author.mini_faced_label_button({\r
18             shorten: true\r
19           }, {\r
20           context: @context,\r
21           click: () =>\r
22             @trigger('http_get', @author.show_url())\r
23         })\r
24         this.$el.append(@author_faced_label_button.render().el)\r
25       fail: (response, opt) =>\r
26         @author_faced_label_error = new Pettanr.View.MiniFacedLabelButton.Error({\r
27         })\r
28         this.$el.append(@author_faced_label_error.render().el)\r
29     })\r
30     this\r
31   \r