class Pettanr.Balloon extends Peta.Element\r
+ url: '/balloons/'\r
+ \r
@singular: () ->\r
'Balloon'\r
\r
r: 0\r
} \r
\r
- url: () ->\r
+ speech_balloon: () ->\r
+ new Pettanr.SpeechBalloon({id: @get('speech_balloon_id')})\r
+ \r
+ system_picture: () ->\r
+ new Pettanr.SystemPicture({id: @get('system_picture_id')})\r
+ \r
+ r_url: () ->\r
'/system_pictures/' + @system_picture().filename()\r
\r
symbol_option: () ->\r
- @speech_balloon().speech_balloon_template().symbol_option()\r
- \r
- style: () ->\r
- {\r
- width: Pettanr.to_s(@get('width')) + 'px', \r
- height: Pettanr.to_s(@get('height')) + 'px',\r
- top: Pettanr.to_s(@get('y')) + 'px',\r
- left: Pettanr.to_s(@get('x')) + 'px'\r
- }\r
+ sb = @speech_balloon()\r
+ sb.fetch({cache: true}).done =>\r
+ sbt = sb.speech_balloon_template()\r
+ sbt.fetch({cache: true}).done =>\r
+ sp = sbt.system_picture()\r
+ sp.fetch({cache: true}).done =>\r
+ @trigger('ready:symbol', sp.tmb_opt_img_tag())\r
\r
initialize: () ->\r
if @id\r
@url = @url + @id\r
+ @bind('change:width', () ->\r
+ console.log('cng')\r
+ )\r
\r
-class Pettanr.Balloon.Collection extends Backbone.Collection\r
- model: Pettanr.Balloon\r
- url: '/balloons'\r
-\r