OSDN Git Service

add bucket
[pettanr/pettanr.git] / app / assets / javascripts / locmare / filer / pager.js.coffee
index a1aab69..8016c5d 100644 (file)
@@ -4,18 +4,16 @@ class Locmare.FilerModule.DefaultPager extends Backbone.View
   \r
   initialize: (options) ->\r
     @page_status = options.page_status\r
-    @counter = @page_status.counter\r
+    @count = @page_status.count\r
     @current_page = @page_status.current_page\r
     @per_page = @page_status.per_page\r
     @window_size = @page_status.window_size\r
     @params = @page_status.params\r
     @parts = []\r
-    _this = this\r
-    @counter.fetch().done ->\r
-      _this.total = _this.counter.get('count')\r
-      _this.total_page = Math.floor(_this.total / _this.per_page) + 1\r
-      if _this.total_page > 1\r
-        _this.render()\r
+    @total = @count\r
+    @total_page = Math.floor(@total / @per_page) + 1\r
+    if @total_page > 1\r
+      @render()\r
   \r
   render: () ->\r
     @parts = []\r
@@ -24,7 +22,7 @@ class Locmare.FilerModule.DefaultPager extends Backbone.View
     this.$el.html('')\r
     _.each @parts, (part) ->\r
       _this.$el.append(part.render().el)\r
-    rb = new Pettanr.Tag.Div({class_name: 'row_break', content: ''})\r
+    rb = new Tag.RowBreak()\r
     this.$el.append(rb.render().el)\r
     this\r
   \r
@@ -72,7 +70,7 @@ class Locmare.FilerModule.DefaultPager.FirstPage extends Backbone.View
     _.extend(my_params, @params)\r
     my_params['page'] = 1\r
     url = Pettanr.url(my_params['controller'], my_params['action'], my_params)\r
-    linked_caption = new Pettanr.Tag.A({\r
+    linked_caption = new Tag.A({\r
       attr: {href: '/' + url}, \r
       handler_name: url,\r
       content: '<<'\r
@@ -94,7 +92,7 @@ class Locmare.FilerModule.DefaultPager.PrevPage extends Backbone.View
     _.extend(my_params, @params)\r
     my_params['page'] = @current_page - 1\r
     url = Pettanr.url(my_params['controller'], my_params['action'], my_params)\r
-    linked_caption = new Pettanr.Tag.A({\r
+    linked_caption = new Tag.A({\r
       attr: {href: '/' + url}, \r
       handler_name: url,\r
       content: '<'\r
@@ -125,7 +123,7 @@ class Locmare.FilerModule.DefaultPager.Page extends Backbone.View
     _.extend(my_params, @params)\r
     my_params['page'] = @page\r
     url = Pettanr.url(my_params['controller'], my_params['action'], my_params)\r
-    linked_caption = new Pettanr.Tag.A({\r
+    linked_caption = new Tag.A({\r
       attr: {href: '/' + url}, \r
       handler_name: url,\r
       content: @page\r
@@ -147,7 +145,7 @@ class Locmare.FilerModule.DefaultPager.NextPage extends Backbone.View
     _.extend(my_params, @params)\r
     my_params['page'] = @current_page + 1\r
     url = Pettanr.url(my_params['controller'], my_params['action'], my_params)\r
-    linked_caption = new Pettanr.Tag.A({\r
+    linked_caption = new Tag.A({\r
       attr: {href: '/' + url}, \r
       handler_name: url,\r
       content: '>'\r
@@ -169,7 +167,7 @@ class Locmare.FilerModule.DefaultPager.LastPage extends Backbone.View
     _.extend(my_params, @params)\r
     my_params['page'] = @pager.total_page\r
     url = Pettanr.url(my_params['controller'], my_params['action'], my_params)\r
-    linked_caption = new Pettanr.Tag.A({\r
+    linked_caption = new Tag.A({\r
       attr: {href: '/' + url}, \r
       handler_name: url,\r
       content: '>>'\r