OSDN Git Service

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