OSDN Git Service

fix: fetch fail
[pettanr/pettanr.git] / app / assets / javascripts / view / show / footer / footer.js.coffee
1 #\r
2 #   new Footer.Footer(item, this, {\r
3 #     edit: {\r
4 #       click: () =>\r
5 #         ...\r
6 #     }\r
7 #   })\r
8 #\r
9 #\r
10 #   new Footer.Footer(null, this, {\r
11 #     edit: {\r
12 #       item: item1,\r
13 #       dic_name: 'translation.key',\r
14 #       click: () =>\r
15 #         ...\r
16 #     }\r
17 #   })\r
18 class Pettanr.View.Show.Footer.Footer extends Pettanr.View\r
19   tagName: 'div'\r
20   className: 'show-owner-footer'\r
21   \r
22   constructor: (@item, @context, options) ->\r
23     super(options)\r
24   \r
25   initialize: (options) ->\r
26     @buttons = []\r
27     _.each options, (setting, action) =>\r
28       setting.context ||= @context\r
29       i = @item || setting.item\r
30       @buttons.push(new Pettanr.View.Button.ItemAction(i, action, setting))\r
31   \r
32   render: () ->\r
33     this.$el.html('')\r
34     _.each @buttons, (button) =>\r
35       this.$el.append(button.render().el)\r
36     this\r
37   \r