OSDN Git Service

fix: any
[pettanr/pettanr.git] / app / assets / javascripts / views / speech_balloons / element_face.js.coffee
index 532b0c7..319ec35 100644 (file)
@@ -1,4 +1,4 @@
-class Pettanr.Views.SpeechBalloon.ElementSymbol extends Backbone.View\r
+class Pettanr.Views.SpeechBalloon.ElementSymbol extends Pettanr.View\r
   tagName: 'div'\r
   className: 'elements-tab-face-icon'\r
   \r
@@ -6,16 +6,18 @@ class Pettanr.Views.SpeechBalloon.ElementSymbol extends Backbone.View
     @element = options.element\r
   \r
   render: () ->\r
-    speech_balloon_template = @element.speech_balloon_template()\r
-    _this = this\r
-    speech_balloon_template.fetch({cache: true}).done ->\r
-      system_picture = speech_balloon_template.system_picture()\r
-      system_picture.fetch({cache: true}).done ->\r
-        img = system_picture.tmb_opt_img_tag()\r
-        _this.$el.html(img.render().el)\r
+    this.$el.html('')\r
+    @element.get_parent('speech_balloon_template', this, {\r
+      success: (@speech_balloon_template) =>\r
+        @speech_balloon_template.get_parent('system_picture', this, {\r
+          success: (@system_picture) =>\r
+            icon = new Pettanr.View.Icon(@system_picture.symbol_file())\r
+            this.$el.html(icon.render().el)\r
+        })\r
+    })\r
     this\r
   \r
-class Pettanr.Views.SpeechBalloon.ElementFace extends Backbone.View\r
+class Pettanr.Views.SpeechBalloon.ElementFace extends Pettanr.View\r
   tagName: 'div'\r
   className: 'elements-tab'\r
   \r
@@ -26,11 +28,6 @@ class Pettanr.Views.SpeechBalloon.ElementFace extends Backbone.View
     this.$el.html('')\r
     symbol = new Pettanr.Views.SpeechBalloon.ElementSymbol({element: @element})\r
     this.$el.append(symbol.render().el)\r
-    speech = @element.get('speech')\r
-    name = Pettanr.truncate(speech.get('content'), 15)\r
-    caption = new Tag.Span({class_name: 'elements-tab-face-caption', content: name})\r
-    this.$el.append(caption.render().el)\r
-    fe = new Tag.Div({class_name: 'elements-tab-face-end'})\r
-    this.$el.append(fe.render().el)\r
+    @append_rb()\r
     this\r
   \r