OSDN Git Service

b6eef8b6a2b3a3f26b6ac7a1c0b3c5dc83229f6f
[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     @filer = null\r
8     m = new Pettanr.FilerCollection({}, @has_many_manifest.list_options(@item().get('id')))\r
9     _this = this\r
10     m.fetch().done ->\r
11       items = m.models\r
12       #_this.filer = new Locmare.Filer(_this.has_many_model().item_name, items, @pager, _this.profiler().operators)\r
13       _this.render()\r
14   \r
15   render: () ->\r
16     this.$el.html('')\r
17     if @filer\r
18       this.$el.html(@filer.render().el)\r
19     this\r
20   \r
21   item: () ->\r
22     @profiler().item\r
23   \r
24   has_many_model: () ->\r
25     @has_many_manifest.model()\r
26   \r
27   profiler: () ->\r
28     @association.profiler\r
29  \r