OSDN Git Service

fix event names
[pettanr/pettanr.git] / app / assets / javascripts / controllers / original_pictures.js.coffee
1 class Pettanr.OriginalPicturesController extends Pettanr.AppController\r
2   \r
3   index: () ->\r
4     @trigger('title', @params)\r
5     @filer_list()\r
6   \r
7   history: () ->\r
8     @trigger('title', @params)\r
9     @filer_list()\r
10   \r
11   show_html: () -> \r
12     @trigger('title', @params)\r
13     @item.fetch({cache: true}).done =>\r
14       show = new Pettanr.Views.OriginalPicture.Show({\r
15         item: @item,\r
16         operators: @operators\r
17       })\r
18       show.render()\r
19       @trigger('ready', show)\r
20   \r
21   show: () ->\r
22     @set_show()\r
23     switch @params['format']\r
24       when 'prof'\r
25         @show_prof()\r
26       when 'html'\r
27         @show_html()\r
28   \r
29   count: () ->\r
30   \r
31   new: () ->\r
32   \r
33   edit: () ->\r
34   \r
35   create: () ->\r
36     @form.item.overwrite(@operators)\r
37     @listenTo(@form, 'success', @post_success)\r
38     @listenTo(@form, 'fail', @post_fail)\r
39     @form.save()\r
40   \r
41   update: () ->\r
42     @form.item.overwrite(@operators)\r
43     @listenTo(@form, 'success', @post_success)\r
44     @listenTo(@form, 'fail', @post_fail)\r
45     @form.save()\r
46   \r
47   destroy: () ->\r
48     @set_show()\r
49     @item.fetch({cache: true}).done =>\r
50       @listenTo(@item, 'destroy:success', @destroy_success)\r
51       @listenTo(@item, 'destroy:fail', @destroy_fail)\r
52       @item.destroy()\r
53   \r