X-Git-Url: http://git.osdn.net/view?p=pettanr%2Fpettanr.git;a=blobdiff_plain;f=app%2Fassets%2Fjavascripts%2Fmodels%2Fwriting_format.js.coffee;h=834c18adacf92529c03c74edf08f07467da9832d;hp=bc3b1a20cd1f60d7b4f2db1dfae265bb6053b522;hb=aa9eca25671c772ffec8f2f65aecc8a978a2f375;hpb=3f0b76f7b7fddc70ba3badd2a97b2babe9549b79 diff --git a/app/assets/javascripts/models/writing_format.js.coffee b/app/assets/javascripts/models/writing_format.js.coffee index bc3b1a20..834c18ad 100644 --- a/app/assets/javascripts/models/writing_format.js.coffee +++ b/app/assets/javascripts/models/writing_format.js.coffee @@ -1,5 +1,4 @@ class Pettanr.WritingFormat extends Peta.Template - url: '/writing_formats/' @singular: () -> 'WritingFormat' @@ -12,15 +11,16 @@ class Pettanr.WritingFormat extends Peta.Template } system_picture: () -> - new Pettanr.SystemPicture({id: @get('system_picture_id')}) + new Pettanr.Cache.Retriever(Pettanr.SystemPicture, @get('system_picture_id')) symbol_option: () -> - i = @system_picture() - i.fetch({cache: true}).done => - @trigger('ready:symbol', i.tmb_opt_img_tag()) + retriever = @system_picture() + @listenTo(retriever, 'retrieve', @retrieve_system_picture) + retriever.retrieve() + + retrieve_system_picture: (item) -> + @trigger('ready:symbol', item.tmb_opt_img_tag()) initialize: (attr = {}, options = {}) -> super(attr, options) - if @id - @url = @url + @id