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=06332e6503cf9c9bdbafea60b967e563aed94196;hpb=0a155175c4fc4f412946e854089ec97d8b1766ae;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 06332e65..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('') @@ -23,8 +22,8 @@ class Pettanr.Views.SpeechBalloon.Summary extends Pettanr.Views.Common.Summary this panel_click: () -> - @trigger('navigate', @panel_icon.url()) + @trigger('http_get', @panel_icon.url()) author_click: () -> - @trigger('navigate', @author_icon_with_caption.url()) + @trigger('http_get', @author_icon_with_caption.url())