@visible = new Tag.Div({\r
content: Pettanr.AppHelper.t_selected_item(@visible_t, @item.get(@visible_column_name))\r
})\r
- @author = @item.author()\r
- @author.fetch({cache: true}).done =>\r
- @author_icon_with_caption = @author.icon_with_caption_view(true, 'name', 12)\r
- @listenTo(@author_icon_with_caption, 'click', @author_click)\r
- @trigger('ready')\r
+ @empty_author = @item.author()\r
+ @author = Pettanr.cache.restore(@empty_author)\r
+ if @author\r
+ # got cached author\r
+ @render_author()\r
+ else\r
+ # built empty author\r
+ @author = @empty_author\r
+ @author.fetch({cache: true}).done =>\r
+ Pettanr.cache.store(@author)\r
+ @render_author()\r
\r
render: () ->\r
this.$el.html('')\r
this.$el.append(@author_icon_with_caption.render().el)\r
this\r
\r
+ render_author: () ->\r
+ @author_icon_with_caption = @author.icon_with_caption_view(true, 'name', 12)\r
+ @listenTo(@author_icon_with_caption, 'click', @author_click)\r
+ @trigger('ready')\r
+ \r
author_click: () ->\r
@trigger('http_get', @author_icon_with_caption.url())\r
\r