OSDN Git Service

fix summary
[pettanr/pettanr.git] / app / assets / javascripts / views / common.js.coffee
1 class Pettanr.Views.Common\r
2 class Pettanr.Views.Common.Icon extends Backbone.View\r
3   tagName: 'span'\r
4   \r
5   initialize: (options) ->\r
6     @item = options.item\r
7     @half = options.half\r
8     @icon_url = Pettanr.url(@item.table_name(), 'show', {id: @item.get('id')})\r
9     @icon = new Pettanr.Image.Icon({item: @item, half: @half})\r
10     @icon_button = new Tag.A({\r
11       attr: {href: '/' + @icon_url}, \r
12       handler_name: @icon_url,\r
13       class_name: 'icon',\r
14       content: @icon.render().el\r
15     })\r
16   \r
17   render: () ->\r
18     this.$el.html(@icon_button.render().el)\r
19     this\r
20   \r