X-Git-Url: http://git.osdn.net/view?a=blobdiff_plain;f=app%2Fassets%2Fjavascripts%2Fmodels%2Fground_color.js.coffee;h=fc7ba8d44d2cfc92d61fbf9922e8bc8c2dc3d330;hb=7cc9010daab46f2f6ae0b0314904ad9704022e7f;hp=7839866f18638c494142f3a9dadb794556f056d2;hpb=eec19634998fd448e4bb1be831260537199d8271;p=pettanr%2Fpettanr.git diff --git a/app/assets/javascripts/models/ground_color.js.coffee b/app/assets/javascripts/models/ground_color.js.coffee index 7839866f..fc7ba8d4 100644 --- a/app/assets/javascripts/models/ground_color.js.coffee +++ b/app/assets/javascripts/models/ground_color.js.coffee @@ -15,14 +15,26 @@ class Pettanr.GroundColor extends Peta.Element @has_picture: () -> false - panel: () -> - new Pettanr.Panel({id: @get('panel_id')}) + @pick_item_name: () -> + '' - initialize: () -> + @pick_model: () -> + Manifest.item_name_to_model(@pick_item_name()) + + @traceable_item_names: () -> + [] + + @is_traceable: (item_name) -> + _.contains(@traceable_item_names(), item_name) + + panel: (options = {}) -> + new Pettanr.Panel({id: @get('panel_id')}, options) + + element_face: () -> + new Pettanr.Views.GroundColor.ElementFace({element: this}) + + initialize: (attr, options) -> + super(attr, options) if @id @url = @url + @id -class Pettanr.GroundColor.Collection extends Backbone.Collection - model: Pettanr.GroundColor - url: '/ground_colors/' -