OSDN Git Service

fix: fetch fail
[pettanr/pettanr.git] / app / assets / javascripts / locmare / profiler / association / has_many.js.coffee
index 6d5af92..010d851 100644 (file)
@@ -18,6 +18,8 @@ class Locmare.ProfilerModule.AssociationModule.HasMany extends Pettanr.View
       success: (page_status) =>\r
         @set_filer()\r
         @render()\r
+      fail: (response, opt) =>\r
+        @open_error_dialog(response, opt)\r
     })\r
     this\r
   \r
@@ -45,11 +47,14 @@ class Locmare.ProfilerModule.AssociationModule.HasMany extends Pettanr.View
     @association.profiler\r
   \r
   add_pick: (target_model) ->\r
-    @list.open((page_status) =>\r
-      @set_filer()\r
-      @render()\r
-      @filer.add_pick(target_model)\r
-    )\r
+    @list.open(this, {\r
+      success: (page_status) =>\r
+        @set_filer()\r
+        @render()\r
+        @filer.add_pick(target_model)\r
+      fail: (response, opt) =>\r
+        @open_error_dialog(response, opt)\r
+    })\r
   \r
   http_get: (url) ->\r
     @trigger('http_get', url)\r