X-Git-Url: http://git.osdn.net/view?a=blobdiff_plain;f=app%2Fassets%2Fjavascripts%2Fviews%2Fspeech_balloons%2Fsummary.js.coffee;h=f39000aa1f4e4bfb643ed179474d2332fbaa2177;hb=4aee0b91a00feddf4b1fcd2ff3e7247efc06f451;hp=3891082864f7bb9b7c003edcd10b499a6ae4bfeb;hpb=c4fc0258365dccdd39e18629bb5d8e5873c658fc;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 38910828..f39000aa 100644 --- a/app/assets/javascripts/views/speech_balloons/summary.js.coffee +++ b/app/assets/javascripts/views/speech_balloons/summary.js.coffee @@ -1,6 +1,7 @@ class Pettanr.Views.SpeechBalloon.Summary extends Pettanr.Views.Common.Summary initialize: (options) -> + super(options) @item = options.item @load() @@ -8,10 +9,22 @@ class Pettanr.Views.SpeechBalloon.Summary extends Pettanr.Views.Common.Summary panel = @item.panel() panel.fetch({cache: true}).done => @panel_icon = new Pettanr.Views.Common.Icon({item: panel, half: true}) - @trigger('ready') + @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') render: () -> this.$el.html('') this.$el.append(@panel_icon.render().el) + this.$el.append(@author_icon_with_caption.render().el) this + panel_click: () -> + @trigger('http_get', @panel_icon.url()) + + author_click: () -> + @trigger('http_get', @author_icon_with_caption.url()) +