OSDN Git Service

fix: show's destroy button
[pettanr/pettanr.git] / app / assets / javascripts / models / panel.js.coffee
index 7b13d47..924c1b7 100644 (file)
@@ -1,5 +1,4 @@
 class Pettanr.Panel extends Peta.Root\r
-  url: '/panels/'\r
   \r
   @singular: () ->\r
     'Panel'\r
@@ -59,27 +58,18 @@ class Pettanr.Panel extends Peta.Root
       r[pid] = elm.picture() if not r[pid]\r
     r\r
   \r
-  my_url: () ->\r
-    s = if @get('id')\r
-      '/' + @get('id')\r
-    else\r
-      ''\r
-    '/' + @path_name() + s\r
-  \r
   initialize: (attr = {}, options = {}) ->\r
     super(attr, options)\r
     @set(attr)\r
-    if @get('id')\r
-      @url = @my_url()\r
   \r
 class Pettanr.Panel.WithElements extends Pettanr.Panel\r
   \r
   fetch: (options) ->\r
-    @url = @my_url() + '?with_elements=true'\r
+    @url = @default_url() + '?with_elements=true'\r
     super(options)\r
   \r
   save: (attrs) ->\r
-    @url = @my_url()\r
+    @url = @default_url()\r
     method = if @isNew()\r
       'create'\r
     else\r