pp: () ->\r
new Pettanr.PanelPicture({id: @get('pp_id')})\r
\r
+ with_elements: () ->\r
+ new Pettanr.Panel.WithElements({id: @get('id')})\r
+ \r
is_visible: (operators) ->\r
switch super(operators)\r
when null # super return\r
r[pid] = elm.picture() if not r[pid]\r
r\r
\r
+ my_url: () ->\r
+ '/' + @path_name() + '/' + @get('id')\r
+ \r
initialize: (attr = {}, options = {}) ->\r
@set(attr)\r
if @get('id')\r
- @url = @url + @get('id')\r
- if options.with_elements\r
- @url = @url + '?with_elements=true'\r
+ @url = @my_url()\r
@bind('change:width', () ->\r
console.log('cng')\r
)\r
\r
+class Pettanr.Panel.WithElements extends Pettanr.Panel\r
+ \r
+ fetch: (options) ->\r
+ @url = @my_url() + '?with_elements=true'\r
+ super(options)\r
+ \r
+ save: (attrs, options = {}) ->\r
+ @url = @my_url()\r
+ options.attrs = {panel: attrs}\r
+ method = if @isNew()\r
+ 'create'\r
+ else\r
+ 'update'\r
+ xhr = @sync(method, this, options)\r
+ xhr\r
+ \r
+ destroy: (options) ->\r
+ @url = @my_url()\r
+ super(options)\r
+ \r