OSDN Git Service

fix editor
[pettanr/pettanr.git] / app / models / balloon.rb
index af41ab4..dc5fa3c 100644 (file)
@@ -16,6 +16,10 @@ class Balloon < Peta::Element
 #  validates :caption, :presence => true
   validates :speech_balloon_template_settings, :boost => {:boost_name => :speech_balloon_template}
 
+  def _y
+    self.attributes['y']
+  end
+  
   def url
     '/system_pictures/' + self.system_picture.filename
   end
@@ -54,7 +58,7 @@ self.system_picture_id = 1
   def style
     {
       'width' => self.width.to_s + 'px','height' => self.height.to_s + 'px',
-      'top' => self.y.to_s + 'px','left' => self.x.to_s + 'px'
+      'top' => self._y.to_s + 'px','left' => self.x.to_s + 'px'
     }
   end