X-Git-Url: http://git.osdn.net/view?a=blobdiff_plain;f=app%2Fassets%2Fjavascripts%2Fviews%2Fspeech_balloons%2Fsummary.js.coffee;h=cc212b2ff7ddf4e94a727965ece825a0c0a2a1ff;hb=dbe1cc622a8fda2e7f24294b97dbd064c1cb197e;hp=f39000aa1f4e4bfb643ed179474d2332fbaa2177;hpb=1faa2a7eb0cca883d62d7e7e36ad7e3a7530a6a2;p=pettanr%2Fpettanr.git diff --git a/app/assets/javascripts/views/speech_balloons/summary.js.coffee b/app/assets/javascripts/views/speech_balloons/summary.js.coffee index f39000aa..cc212b2f 100644 --- a/app/assets/javascripts/views/speech_balloons/summary.js.coffee +++ b/app/assets/javascripts/views/speech_balloons/summary.js.coffee @@ -1,20 +1,19 @@ -class Pettanr.Views.SpeechBalloon.Summary extends Pettanr.Views.Common.Summary +class Pettanr.Views.SpeechBalloon.Summary extends Pettanr.View.Summary initialize: (options) -> super(options) @item = options.item - @load() - - load: () -> - panel = @item.panel() - panel.fetch({cache: true}).done => - @panel_icon = new Pettanr.Views.Common.Icon({item: panel, half: true}) - @listenTo(@panel_icon, 'click', @panel_click) - author = panel.author() - author.fetch({cache: true}).done => - @author_icon_with_caption = author.icon_with_caption_view(true, 'name', 12) - @listenTo(@author_icon_with_caption, 'click', @author_click) - @trigger('ready') + @item.get_parent('panel', this, { + success: (@panel) => + @panel_icon = new Pettanr.Views.Common.Icon({item: @panel, half: true}) + @listenTo(@panel_icon, 'click', @panel_click) + @panel.get_parent('author', this, { + success: (@author) => + @author_icon_with_caption = @author.icon_with_caption_view(true, 'name', 12) + @listenTo(@author_icon_with_caption, 'click', @author_click) + @trigger('ready') + }) + }) render: () -> this.$el.html('')