X-Git-Url: http://git.osdn.net/view?p=pettanr%2Fpettanr.git;a=blobdiff_plain;f=app%2Fassets%2Fjavascripts%2Fviews%2Fballoons%2Fshow.js.coffee;fp=app%2Fassets%2Fjavascripts%2Fviews%2Fballoons%2Fshow.js.coffee;h=d87cd8f04a239b427c47bebbd2ad578fd8a8ceb1;hp=a02f82c3b6d9059f790897a47fed327bc4cba6cd;hb=18a9968f3ae8f024ba24f917969ac541ef403a5e;hpb=5311097b7883c5e7eed0a5b2ce739ea2ae894c76 diff --git a/app/assets/javascripts/views/balloons/show.js.coffee b/app/assets/javascripts/views/balloons/show.js.coffee index a02f82c3..d87cd8f0 100644 --- a/app/assets/javascripts/views/balloons/show.js.coffee +++ b/app/assets/javascripts/views/balloons/show.js.coffee @@ -10,19 +10,23 @@ class Pettanr.Views.Balloon.Show extends Pettanr.View.Show @speech_balloon.get_parent('panel', this, { success: (item) => @panel = item.play() - @panel.fetch().done => - @panel.attributes = @panel.decoded_attributes() - @authored_by = @panel.authored_by() - @body = new Pettanr.Views.Panel.Body({ - panel: @panel, - spot: @item - }) - @listenTo(@header, 'click:pick', @click_pick) - @listenTo(@authored_by, 'click', @click_authored_by) - this.$el.append(@header.render().el) - this.$el.append(@authored_by.render().el) - this.$el.append(@body.render().el) - @add_credits() + @panel.fetch({ + success: (model, response, opt) => + @panel.attributes = @panel.decoded_attributes() + @authored_by = @panel.authored_by() + @body = new Pettanr.Views.Panel.Body({ + panel: @panel, + spot: @item + }) + @listenTo(@header, 'click:pick', @click_pick) + @listenTo(@authored_by, 'click', @click_authored_by) + this.$el.append(@header.render().el) + this.$el.append(@authored_by.render().el) + this.$el.append(@body.render().el) + @add_credits() + error: (item, response, opt) => + @open_error_dialog(response, opt) + }) }) }) this