1 class Pettanr.Panel extends Peta.Root
\r
17 new Pettanr.Author({id: @get('author_id')})
\r
20 new Pettanr.PanelPicture({id: @get('pp_id')})
\r
22 with_elements: () ->
\r
23 new Pettanr.Panel.WithElements({id: @get('id')})
\r
25 is_visible: (operators) ->
\r
26 switch super(operators)
\r
27 when null # super return
\r
32 return true if @isNew()
\r
35 overwrite: (options) ->
\r
36 @set('author_id', options.operators.author.id)
\r
38 is_usable: (operators) ->
\r
39 @is_visible(operators)
\r
44 @licensed_pictures: (panels) ->
\r
46 _.each panels, (panel) ->
\r
47 _.extend r, panel.licensed_pictures()
\r
50 licensed_pictures: () ->
\r
52 _.each @scenario_elements(), (elm) ->
\r
53 return if not elm.my_class().has_picture()
\r
54 pid = elm.get('picture_id')
\r
55 r[pid] = elm.picture() if not r[pid]
\r
59 '/' + @path_name() + '/' + @get('id')
\r
61 initialize: (attr = {}, options = {}) ->
\r
65 @bind('change:width', () ->
\r
69 class Pettanr.Panel.WithElements extends Pettanr.Panel
\r
72 @url = @my_url() + '?with_elements=true'
\r
75 save: (attrs, options = {}) ->
\r
77 options.attrs = {panel: attrs}
\r
78 method = if @isNew()
\r
82 xhr = @sync(method, this, options)
\r
85 destroy: (options) ->
\r