1 class Pettanr.GroundPicture extends Peta.Element
\r
2 url: '/ground_pictures/'
\r
17 @repeat_texts: () ->
\r
18 ['repeat', 'repeat-x', 'repeat-y', 'no-repeat']
\r
21 new Pettanr.Picture({id: @get('picture_id')})
\r
26 style: (spot = null, opacity = 20) ->
\r
28 position: 'absolute',
\r
31 'z-index': @get('z'),
\r
32 'background-image': 'url(' + @picture().r_url() + ')',
\r
33 'background-repeat': @repeat_text(),
\r
34 'background-position': Pettanr.to_s(@get('x')) + 'px ' + Pettanr.to_s(@get('y')) + 'px'
\r
36 @merge_opacity(r, opacity) if spot and spot != this
\r
39 tmb_opt_img_tag: (picture) ->
\r
40 wh = Pettanr.Imager.thumbnail_size(picture().get('width'), picture().get('height'))
\r
41 new Pettanr.AppHelperImg({src: picture.r_url(), size: Math.abs(wh[0]), alt: @get('caption')})
\r
43 symbol_option: (cb) ->
\r
47 cb(_this.tmb_opt_img_tag(i))
\r
50 Pettanr.GroundPicture.repeat_texts()[@get('repeat')]
\r
56 class Pettanr.GroundPicture.Collection extends Backbone.Collection
\r
57 model: Pettanr.GroundPicture
\r
58 url: '/ground_pictures'
\r