OSDN Git Service

fix: fetch fail
[pettanr/pettanr.git] / app / assets / javascripts / controllers / ground_colors.js.coffee
index ec50f36..a0cb68f 100644 (file)
@@ -1,41 +1,37 @@
 class Pettanr.GroundColorsController extends Pettanr.AppController\r
   \r
   index: () ->\r
+    @trigger('title', @params)\r
     @filer_list()\r
+    @trigger('done', @params)\r
   \r
   by_author: () ->\r
+    @trigger('title', @params)\r
     @filer_list()\r
+    @trigger('done', @params)\r
   \r
   by_panel: () ->\r
+    @trigger('title', @params)\r
     @filer_list()\r
-  \r
-  show_html: () -> \r
-    _this = this\r
-    @item.fetch({cache: true}).done ->\r
-      view = new Pettanr.Views.GroundColor.Show({\r
-        el: "#pettanr",\r
-        item: _this.item,\r
-        operators: _this.operators\r
-      })\r
-      #view.render()\r
+    @trigger('done', @params)\r
   \r
   show: () ->\r
-    @set_show()\r
+    @set_show(@render_show)\r
+  \r
+  render_show: (@item) -> \r
     switch @params['format']\r
       when 'prof'\r
         @show_prof()\r
       when 'html'\r
         @show_html()\r
   \r
-  count: () ->\r
-  \r
-  new: () ->\r
-  \r
-  edit: () ->\r
-  \r
-  create: () ->\r
+  show_html: () -> \r
+    @trigger('title', @params, @item.get('caption'))\r
+    show = new Pettanr.Views.GroundColor.Show(@item, {\r
+    })\r
+    show.render()\r
+    @trigger('ready', show)\r
+    @trigger('done', @params)\r
   \r
-  update: () ->\r
+  count: () ->\r
   \r
-  destroy: () ->\r
-    \r