OSDN Git Service

Merge branch 'v06' of git.sourceforge.jp:/gitroot/pettanr/pettanr into v06
[pettanr/pettanr.git] / app / assets / javascripts / views / speeches / show.js.coffee
index 7b6d5f9..2ceb7b0 100644 (file)
@@ -10,19 +10,25 @@ class Pettanr.Views.Speech.Show extends Pettanr.View.Show
         @speech_balloon.get_parent('panel', this, {\r
           success: (item) =>\r
             @panel = item.play()\r
-            @panel.fetch().done =>\r
-              @panel.attributes = @panel.decoded_attributes()\r
-              @authored_by = @panel.authored_by()\r
-              @body = new Pettanr.Views.Panel.Body({\r
-                panel: @panel,\r
-                spot: @item\r
-              })\r
-              @listenTo(@header, 'click:pick', @click_pick)\r
-              @listenTo(@authored_by, 'click', @click_authored_by)\r
-              this.$el.append(@header.render().el)\r
-              this.$el.append(@authored_by.render().el)\r
-              this.$el.append(@body.render().el)\r
-              @add_credits()\r
+            @panel.fetch({\r
+              success: (model, response, opt) => \r
+                @panel.attributes = @panel.decoded_attributes()\r
+                @authored_by = @panel.authored_by()\r
+                @body = new Pettanr.Views.Panel.Body({\r
+                  panel: @panel,\r
+                  spot: @item\r
+                })\r
+                @listenTo(@header, 'click:pick', @click_pick)\r
+                @listenTo(@authored_by, 'click', @click_authored_by)\r
+                this.$el.append(@header.render().el)\r
+                this.$el.append(@authored_by.render().el)\r
+                this.$el.append(@body.render().el)\r
+                @add_credits()\r
+              error: (item, response, opt) =>\r
+                @open_error_dialog(response, opt)\r
+            })\r
+          fail: (response, opt) =>\r
+            @open_error_dialog(response, opt)\r
         })\r
     })\r
     this\r