OSDN Git Service

fix event
[pettanr/pettanr.git] / app / assets / javascripts / views / speeches / summary.js.coffee
index d35d201..cf106ee 100644 (file)
@@ -11,9 +11,11 @@ class Pettanr.Views.Speech.Summary extends Pettanr.Views.Common.Summary
       panel = @speech_balloon.panel()\r
       panel.fetch({cache: true}).done =>\r
         @panel_icon = new Pettanr.Views.Common.Icon({item: panel, half: true})\r
+        @listenTo(@panel_icon, 'click', @panel_click)\r
         author = panel.author()\r
         author.fetch({cache: true}).done =>\r
           @author_icon_with_caption = author.icon_with_caption_view(true, 'name', 12)\r
+          @listenTo(@author_icon_with_caption, 'click', @author_click)\r
           @trigger('ready')\r
   \r
   render: () ->\r
@@ -22,3 +24,9 @@ class Pettanr.Views.Speech.Summary extends Pettanr.Views.Common.Summary
     this.$el.append(@author_icon_with_caption.render().el)\r
     this\r
   \r
+  panel_click: () ->\r
+    @trigger('navigate', @panel_icon.url())\r
+  \r
+  author_click: () ->\r
+    @trigger('navigate', @author_icon_with_caption.url())\r
+  \r