OSDN Git Service

Merge branch 'v06' of git.sourceforge.jp:/gitroot/pettanr/pettanr into v06
[pettanr/pettanr.git] / app / assets / javascripts / view / summary / binder.js.coffee
1 class Pettanr.View.Summary.Binder extends Pettanr.View\r
2   \r
3   initialize: (options) ->\r
4     super(options)\r
5     @item = options.item\r
6     @visible_t = options.visible_t\r
7     @visible_column_name = options.visible_column_name\r
8     @load()\r
9   \r
10   load: () ->\r
11     @visible = new Tag.Div({\r
12       content: Pettanr.AppHelper.t_selected_item(@visible_t, @item.get(@visible_column_name))\r
13     })\r
14     @item.get_parent('author', this, {\r
15       success: (@author) =>\r
16         @author_mini_faced_label = @author.mini_faced_label({\r
17           context: this,\r
18           click: () =>\r
19             @trigger('http_get', @author.show_url())\r
20         })\r
21         this.$el.append(@author_mini_faced_label.render().el)\r
22         @trigger('ready')\r
23     })\r
24   \r
25   render: () ->\r
26     this.$el.html('')\r
27     this.$el.append(@visible.render().el)\r
28     this.$el.append(@author_mini_faced_label.render().el)\r
29     this\r
30   \r
31   author_click: () ->\r
32     @trigger('http_get', @author_icon_with_caption.url())\r
33   \r