OSDN Git Service

fix: views
[pettanr/pettanr.git] / app / assets / javascripts / views / speech_balloons / element_face.js.coffee
1 class Pettanr.Views.SpeechBalloon.ElementSymbol extends Pettanr.View\r
2   tagName: 'div'\r
3   className: 'elements-tab-face-icon'\r
4   \r
5   initialize: (options) ->\r
6     @element = options.element\r
7   \r
8   render: () ->\r
9     this.$el.html('')\r
10     @element.get_parent('speech_balloon_template', this, {\r
11       success: (@speech_balloon_template) =>\r
12         @speech_balloon_template.get_parent('system_picture', this, {\r
13           success: (@system_picture) =>\r
14             img = @system_picture.tmb_opt_img_tag()\r
15             this.$el.html(img.render().el)\r
16         })\r
17     })\r
18     this\r
19   \r
20 class Pettanr.Views.SpeechBalloon.ElementFace extends Pettanr.View\r
21   tagName: 'div'\r
22   className: 'elements-tab'\r
23   \r
24   initialize: (options) ->\r
25     @element = options.element\r
26   \r
27   render: () ->\r
28     this.$el.html('')\r
29     symbol = new Pettanr.Views.SpeechBalloon.ElementSymbol({element: @element})\r
30     this.$el.append(symbol.render().el)\r
31     @append_rb()\r
32     this\r
33   \r