OSDN Git Service

Merge branch 'v06' of git.sourceforge.jp:/gitroot/pettanr/pettanr into v06
[pettanr/pettanr.git] / app / assets / javascripts / models / sheet_panel.js.coffee
index ed3c1b1..d5fcf9c 100644 (file)
@@ -1,25 +1,29 @@
-class SheetPanel extends Item\r
-  @single: () ->\r
+class Pettanr.SheetPanel extends Peta.Leaf\r
+  url: '/sheet_panels/'\r
+  \r
+  @singular: () ->\r
     'SheetPanel'\r
   \r
   @plural: () ->\r
     'SheetPanels'\r
   \r
   defaults: {\r
-    id: 11\r
+    id: null,\r
+    x: 15,\r
+    y: 15,\r
+    sheet_id: null,\r
+    panel_id: null,\r
+    z: 1,\r
+    t: null\r
   } \r
   \r
-  initialize: () ->\r
-    confirm("Welcome to Panel")\r
+  sheet: () ->\r
+    new Pettanr.Sheet({id: @get('sheet_id')})\r
   \r
-  @test: () ->\r
-    confirm( @single())\r
-    confirm( @plural() )\r
-    confirm( @class_name() )\r
-    confirm( @element_name() )\r
-    confirm( @table_name() )\r
-    \r
+  panel: () ->\r
+    new Pettanr.Panel({id: @get('panel_id')})\r
+  \r
+  initialize: () ->\r
+    if @id\r
+      @url = @url + @id\r
   \r
-  test: () ->\r
-\r
-@Panel = Panel\r