OSDN Git Service

913d6b7c0b8877afc5c068d87051d570642717e3
[pettanr/pettanr.git] / app / assets / javascripts / locmare / profiler / association / has_many.js.coffee
1 class Locmare.ProfilerModule.AssociationModule.HasMany extends Backbone.View\r
2   tagName: 'div'\r
3   \r
4   initialize: (options) ->\r
5     @association = options.association\r
6     @has_many_manifest = options.has_many_manifest\r
7     c = @has_many_manifest.list_options(@item().get('id'))\r
8     m = new Pettanr.FilerCollection({}, c)\r
9     @filer = new Locmare.Filer({\r
10       item_name: @has_many_model().item_name(), \r
11       collection: m, \r
12       pager: @pager, \r
13       operators: @profiler().operators\r
14     })\r
15   \r
16   render: () ->\r
17     this.$el.html(@filer.el)\r
18     this\r
19   \r
20   item: () ->\r
21     @profiler().item\r
22   \r
23   has_many_model: () ->\r
24     @has_many_manifest.model()\r
25   \r
26   profiler: () ->\r
27     @association.profiler\r
28  \r