OSDN Git Service

Merge branch 'v06' of git.sourceforge.jp:/gitroot/pettanr/pettanr into v06
[pettanr/pettanr.git] / app / assets / javascripts / models / scroll_panel.js.coffee
index 059d2dc..a4ed1fd 100644 (file)
@@ -1,15 +1,29 @@
 class Pettanr.ScrollPanel extends Peta.Leaf\r
-  @single: () ->\r
+  url: ''\r
+  \r
+  @singular: () ->\r
     'ScrollPanel'\r
   \r
   @plural: () ->\r
     'ScrollPanels'\r
   \r
   defaults: {\r
-    id: 11\r
+    id: null,\r
+    scroll_id: null,\r
+    panel_id: null,\r
+    t: null\r
   } \r
   \r
+  scroll: () ->\r
+    new Pettanr.Scroll({id: @get('scroll_id')})\r
+  \r
+  panel: () ->\r
+    new Pettanr.Panel({id: @get('panel_id')})\r
+  \r
   initialize: () ->\r
-    confirm("Welcome to Panel")\r
+    if @id\r
+      @url = @url + @id\r
   \r
-\r
+class Pettanr.ScrollPanel.Collection extends Backbone.Collection\r
+  model: Pettanr.ScrollPanel\r
+  url: '/scroll_panels'\r