OSDN Git Service

fix:replace row break
[pettanr/pettanr.git] / app / assets / javascripts / views / pictures / credit_icon.js.coffee
1 class Pettanr.Views.Picture.CreditIcon extends Pettanr.View\r
2   tagName: 'span'\r
3   className: 'credit-icon'\r
4   \r
5   initialize: (options) ->\r
6     @item = options.item\r
7     @url = @item.url + '/credit'\r
8   \r
9   render: () ->\r
10     this.$el.html('')\r
11     picture = @item.tmb_opt_img_tag()\r
12     linked_picture = new Tag.A({\r
13       attr: {href: @item.url},\r
14       content: picture.render().el\r
15     })\r
16     @listenTo(linked_picture, 'click', @click)\r
17     this.$el.append(linked_picture.render().el)\r
18     this\r
19   \r
20   click: () ->\r
21     @trigger('click')\r
22   \r