OSDN Git Service

fix sign in,out
[pettanr/pettanr.git] / app / assets / javascripts / models / scroll_panel.js.coffee
index 6224126..c5d83cd 100644 (file)
@@ -14,10 +14,26 @@ class Pettanr.ScrollPanel extends Peta.Leaf
     t: null\r
   } \r
   \r
+  @licensed_pictures: (scroll_panels) ->\r
+    panels = _.filter(scroll_panels, (sp) ->\r
+      sp.has_panel()\r
+    )\r
+    Pettanr.Panel.licensed_pictures(panels)\r
+  \r
+  scroll: () ->\r
+    new Pettanr.Scroll({id: @get('scroll_id')})\r
+  \r
+  panel: () ->\r
+    # get with elm in case play mode\r
+    new Pettanr.Panel.WithElements({id: @get('panel_id')})\r
+  \r
+  has_panel: () ->\r
+    if @get('panel_id')\r
+      true\r
+    else\r
+      false\r
+  \r
   initialize: () ->\r
     if @id\r
       @url = @url + @id\r
   \r
-class Pettanr.ScrollPanel.Collection extends Backbone.Collection\r
-  model: Pettanr.ScrollPanel\r
-  url: '/scroll_panels'\r