OSDN Git Service

fix: fetch fail
[pettanr/pettanr.git] / app / assets / javascripts / view / summary / binder.js.coffee
index 291ac05..15b656c 100644 (file)
@@ -1,33 +1,31 @@
-class Pettanr.View.Summary.Binder extends Pettanr.View\r
+class Pettanr.View.Summary.Binder extends Pettanr.View.Summary\r
   \r
   initialize: (options) ->\r
     super(options)\r
-    @item = options.item\r
     @visible_t = options.visible_t\r
     @visible_column_name = options.visible_column_name\r
-    @load()\r
   \r
-  load: () ->\r
+  render: () ->\r
+    super()\r
     @visible = new Tag.Div({\r
       content: Pettanr.AppHelper.t_selected_item(@visible_t, @item.get(@visible_column_name))\r
     })\r
+    this.$el.html('')\r
+    this.$el.append(@visible.render().el)\r
     @item.get_parent('author', this, {\r
       success: (@author) =>\r
-        @author_mini_faced_label = @author.mini_faced_label({\r
-          context: this,\r
+        @author_faced_label_button = @author.mini_faced_label_button({\r
+            shorten: true\r
+          }, {\r
+          context: @context,\r
           click: () =>\r
             @trigger('http_get', @author.show_url())\r
         })\r
-        this.$el.append(@author_mini_faced_label.render().el)\r
-        @trigger('ready')\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
-  \r
-  render: () ->\r
-    this.$el.html('')\r
-    this.$el.append(@visible.render().el)\r
-    this.$el.append(@author_mini_faced_label.render().el)\r
     this\r
   \r
-  author_click: () ->\r
-    @trigger('http_get', @author_icon_with_caption.url())\r
-  \r