OSDN Git Service

fix event names
[pettanr/pettanr.git] / app / assets / javascripts / locmare / profiler / association / belongs_to.js.coffee
index d10b983..4813f60 100644 (file)
@@ -6,15 +6,15 @@ class Locmare.ProfilerModule.AssociationModule.BelongsTo extends Backbone.View
     @belongs_to_manifest = options.belongs_to_manifest\r
     pm = @parent_model()\r
     m = new pm({id: @parent_id()})\r
-    _this = this\r
-    m.fetch({cache: true}).done ->\r
-      _this.filer = new Locmare.Filer({\r
-        item_name: _this.parent_model().item_name(), \r
+    m.fetch({cache: true}).done =>\r
+      @filer = new Locmare.Filer({\r
+        item_name: @parent_model().item_name(), \r
         items: [m], \r
         pager: null, \r
-        operators: _this.profiler().operators\r
+        operators: @profiler().operators\r
       })\r
-      _this.render()\r
+      @listenTo(@filer, 'http_get', @http_get)\r
+      @render()\r
   \r
   render: () ->\r
     this.$el.html(@filer.el) if @filer\r
@@ -39,3 +39,6 @@ class Locmare.ProfilerModule.AssociationModule.BelongsTo extends Backbone.View
   profiler: () ->\r
     @association.profiler\r
   \r
+  http_get: (url) ->\r
+    @trigger('http_get', url)\r
+  \r