OSDN Git Service

3f531c0b6070b5e982fe65046de294d024f30dfe
[pettanr/pettanr.git] / app / assets / javascripts / views / scrolls / summary.js.coffee
1 class Pettanr.Views.Scroll.Summary extends Backbone.View\r
2   \r
3   initialize: (options) ->\r
4     @item = options.item\r
5     @visible = new Tag.Div({\r
6       content: Pettanr.AppHelper.t_selected_item('scroll_visible_items', @item.get('visible'))\r
7     })\r
8     _this = this\r
9     @author = @item.author()\r
10     @author.fetch().done ->\r
11       _this.author_icon = _this.author.icon_view(true)\r
12       _this.author_name = _this.author.name_view(12)\r
13       _this.render()\r
14   \r
15   render: () ->\r
16     this.$el.html('')\r
17     this.$el.append(@visible.render().el)\r
18     if @author_icon\r
19       this.$el.append(@author_icon.render().el)\r
20       this.$el.append(@author_name.render().el)\r
21     this\r
22   \r