OSDN Git Service

fix: fetch fail
[pettanr/pettanr.git] / app / assets / javascripts / view / summary / leaf.js.coffee
index f578b07..9b704e2 100644 (file)
@@ -27,6 +27,7 @@ class Pettanr.View.Summary.Leaf.Binder extends Pettanr.View
   \r
   render: () ->\r
     super()\r
+    this.$el.html('')\r
     @item.get_parent(@binder_model.item_name(), this, {\r
       success: (@binder) =>\r
         @face_button = @binder.mini_face_button({\r
@@ -34,6 +35,7 @@ class Pettanr.View.Summary.Leaf.Binder extends Pettanr.View
           click: () =>\r
             @trigger('http_get', @binder.show_url())\r
         })\r
+        this.$el.append(@face_button.render().el)\r
         @binder.get_parent('author', this, {\r
           success: (@author) =>\r
             @author_faced_label_button = @author.mini_faced_label_button({\r
@@ -43,10 +45,14 @@ class Pettanr.View.Summary.Leaf.Binder extends Pettanr.View
               click: () =>\r
                 @trigger('http_get', @author.show_url())\r
             })\r
-            this.$el.html('')\r
-            this.$el.append(@face_button.render().el)\r
             this.$el.append(@author_faced_label_button.render().el)\r
+          fail: (response, opt) =>\r
+            author_faced_label_error = new Pettanr.View.MiniFacedLabelButton.Error({\r
+            })\r
+            this.$el.append(author_faced_label_error.render().el)\r
         })\r
+      fail: (response, opt) =>\r
+        this.$el.append(I18n.t('yasapp.unresolved'))\r
     })\r
     this\r
   \r
@@ -62,6 +68,7 @@ class Pettanr.View.Summary.Leaf.Destination extends Pettanr.View
   \r
   render: () ->\r
     super()\r
+    this.$el.html('')\r
     @item.get_parent(@destination_model.item_name(), this, {\r
       success: (@destination) =>\r
         @face_button = @destination.mini_face_button({\r
@@ -69,6 +76,7 @@ class Pettanr.View.Summary.Leaf.Destination extends Pettanr.View
           click: () =>\r
             @trigger('http_get', @binder.show_url())\r
         })\r
+        this.$el.append(@face_button.render().el)\r
         @destination.get_parent('author', this, {\r
           success: (@author) =>\r
             @author_faced_label_button = @author.mini_faced_label_button({\r
@@ -78,10 +86,14 @@ class Pettanr.View.Summary.Leaf.Destination extends Pettanr.View
               click: () =>\r
                 @trigger('http_get', @author.show_url())\r
             })\r
-            this.$el.html('')\r
-            this.$el.append(@face_button.render().el)\r
             this.$el.append(@author_faced_label_button.render().el)\r
+          fail: (response, opt) =>\r
+            author_faced_label_error = new Pettanr.View.MiniFacedLabelButton.Error({\r
+            })\r
+            this.$el.append(author_faced_label_error.render().el)\r
         })\r
+      fail: (response, opt) =>\r
+        this.$el.append(I18n.t('yasapp.unresolved'))\r
     })\r
     this\r
   \r