OSDN Git Service

merge:
[pettanr/pettanr.git] / app / assets / javascripts / models / writing_format.js.coffee
1 class Pettanr.WritingFormat extends Peta.Template\r
2   url: '/writing_formats/'\r
3   \r
4   @singular: () ->\r
5     'WritingFormat'\r
6   \r
7   @plural: () ->\r
8     'WritingFormats'\r
9   \r
10   defaults: {\r
11     id: null\r
12   } \r
13   \r
14   system_picture: () ->\r
15     new Pettanr.Cache.Retriever(Pettanr.SystemPicture, @get('system_picture_id'))\r
16   \r
17   symbol_option: () ->\r
18     retriever = @system_picture()\r
19     @listenTo(retriever, 'retrieve', @retrieve_system_picture)\r
20     retriever.retrieve()\r
21   \r
22   retrieve_system_picture: (item) -> \r
23     @trigger('ready:symbol', item.tmb_opt_img_tag())\r
24   \r
25   initialize: (attr = {}, options = {}) ->\r
26     super(attr, options)\r
27     if @id\r
28       @url = @url + @id\r
29   \r