OSDN Git Service

fix:replace row break
[pettanr/pettanr.git] / app / assets / javascripts / views / pictures / credit.js.coffee
1 class Pettanr.Views.Picture.Credit extends Pettanr.View\r
2   tagName: 'div'\r
3   className: 'credit'\r
4   \r
5   initialize: (options) ->\r
6     @item = options.item\r
7     @with_icon = options.with_icon\r
8     @url = @item.url + '/credit'\r
9   \r
10   render: () ->\r
11     this.$el.html('')\r
12     if @with_icon\r
13       p = @item.credit_icon_view()\r
14       @listenTo(p, 'click', @click)\r
15       this.$el.append(p.render().el)\r
16     f = (data, status) =>\r
17       this.$el.append(data)\r
18       @rb()\r
19     $.get(@url, null, f, 'html')\r
20     this\r
21   \r
22   click: () ->\r
23     @trigger('click:icon', @item)\r
24   \r