OSDN Git Service

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