OSDN Git Service

fix changing WithElements
[pettanr/pettanr.git] / app / assets / javascripts / controllers / balloons.js.coffee
index 847b42a..f33d702 100644 (file)
@@ -1,23 +1,26 @@
 class Pettanr.BalloonsController extends Pettanr.AppController\r
   \r
   index: () ->\r
+    @trigger('retitle', @params)\r
     @filer_list()\r
   \r
   by_author: () ->\r
+    @trigger('retitle', @params)\r
     @filer_list()\r
   \r
   by_speech_balloon: () ->\r
+    @trigger('retitle', @params)\r
     @filer_list()\r
   \r
   show_html: () -> \r
-    _this = this\r
-    @item.fetch({cache: true}).done ->\r
-      view = new Pettanr.Views.Balloon.Show({\r
-        el: "#pettanr",\r
-        item: _this.item,\r
-        operators: _this.operators\r
+    @trigger('retitle', @params)\r
+    @item.fetch({cache: true}).done =>\r
+      show = new Pettanr.Views.Balloon.Show({\r
+        item: @item,\r
+        operators: @operators\r
       })\r
-      view.render()\r
+      show.render()\r
+      @trigger('ready', show)\r
   \r
   show: () ->\r
     @set_show()\r