OSDN Git Service

Merge branch 'v06' of git.sourceforge.jp:/gitroot/pettanr/pettanr into v06
[pettanr/pettanr.git] / app / assets / javascripts / view / pick.js.coffee
1 class Pettanr.View.Pick extends Pettanr.View\r
2   \r
3   constructor: (@type, options) ->\r
4     super(options)\r
5   \r
6   initialize: (options) ->\r
7     @class_name = options.class_name\r
8     @content = if @is_button()\r
9       new Pettanr.View.Button('/pick', @icon().render().el, options)\r
10     else\r
11       @icon()\r
12   \r
13   render: () ->\r
14     this.$el.html('')\r
15     @el.className = @class_name if @class_name\r
16     this.$el.append(@content.render().el)\r
17     this\r
18   \r
19   is_button: () ->\r
20     @type != 'none'\r
21   \r
22   icon: () ->\r
23     new Pettanr.View.Icon(Pettanr.View.Image.icon_pick_file(@type))\r
24   \r
25 class Pettanr.View.MiniPick extends Pettanr.View.Pick\r
26   \r
27   icon: () ->\r
28     new Pettanr.View.Minicon(Pettanr.View.Image.icon_pick_file(@type))\r
29   \r