class Pettanr.GroundPicture extends Peta.Element\r
+ url: '/ground_pictures/'\r
+ \r
@singular: () ->\r
'GroundPicture'\r
\r
['repeat', 'repeat-x', 'repeat-y', 'no-repeat']\r
\r
picture: () ->\r
- @get('picture')\r
+ new Pettanr.Picture({id: @get('picture_id')})\r
\r
has_picture: () ->\r
true\r
@merge_opacity(r, opacity) if spot and spot != this\r
r\r
\r
- tmb_opt_img_tag: () ->\r
- wh = Pettanr.Imager.thumbnail_size(@picture().get('width'), @picture().get('height'))\r
- {src: @picture().r_url(), width: wh[0], height: wh[1], alt: @get('caption')}\r
+ tmb_opt_img_tag: (picture) ->\r
+ wh = Pettanr.Imager.thumbnail_size(picture().get('width'), picture().get('height'))\r
+ new Pettanr.AppHelperImg({src: picture.r_url(), size: Math.abs(wh[0]), alt: @get('caption')})\r
\r
- symbol_option: () ->\r
- @tmb_opt_img_tag()\r
+ symbol_option: (cb) ->\r
+ i = @picture()\r
+ _this = this\r
+ i.fetch().done ->\r
+ cb(_this.tmb_opt_img_tag(i))\r
\r
repeat_text: () ->\r
Pettanr.GroundPicture.repeat_texts()[@get('repeat')]\r