OSDN Git Service

Merge branch 'v06' of git.sourceforge.jp:/gitroot/pettanr/pettanr into v06
[pettanr/pettanr.git] / app / assets / javascripts / models / scroll.js.coffee
index 880932a..2bfb905 100644 (file)
@@ -1,5 +1,5 @@
 class Pettanr.Scroll extends Peta.Binder\r
-  url: ''\r
+  url: '/scrolls/'\r
   \r
   @singular: () ->\r
     'Scroll'\r
@@ -9,12 +9,19 @@ class Pettanr.Scroll extends Peta.Binder
   \r
   defaults: {\r
     id: null,\r
+    visible: 0\r
   } \r
   \r
-  initialize: () ->\r
+  author: () ->\r
+    new Pettanr.Cache.Retriever(Pettanr.Author, @get('author_id'))\r
+  \r
+  overwrite: (options) ->\r
+    operators = Pettanr.cache.operators\r
+    return false if not operators.author\r
+    @set('author_id', operators.author.id)\r
+  \r
+  initialize: (attr = {}, options = {}) ->\r
+    super(attr, options)\r
     if @id\r
       @url = @url + @id\r
   \r
-class Pettanr.Scroll.Collection extends Backbone.Collection\r
-  model: Pettanr.Scroll\r
-  url: '/scrolls'\r