[Groonga-commit] groonga/gcs [ember] Fix number of showing records

Back to archive index

Yoji SHIDARA null+****@clear*****
Tue Sep 25 15:23:52 JST 2012


Yoji SHIDARA	2012-09-25 15:23:52 +0900 (Tue, 25 Sep 2012)

  New Revision: 33db99fa03f862203d31a3f10209de89846fbb3d
  https://github.com/groonga/gcs/commit/33db99fa03f862203d31a3f10209de89846fbb3d

  Log:
    Fix number of showing records

  Modified files:
    public/js/gcs.js

  Modified: public/js/gcs.js (+5 -2)
===================================================================
--- public/js/gcs.js    2012-09-25 13:34:32 +0900 (c4f3306)
+++ public/js/gcs.js    2012-09-25 15:23:52 +0900 (04c71be)
@@ -23,13 +23,16 @@ App.SearchController = Ember.ArrayController.extend({
   query: null,
   perPage: 5,
   start: 0,
-  numEnd: null,
   numHits: null,
+  numReceived: null,
   resultsAvailable: null,
   searched: false,
   numStart: function() {
     return this.get('start') + 1;
   }.property('start'),
+  numEnd: function() {
+    return this.get('start') + this.get('numReceived');
+  }.property('numReceived', 'start'),
   urlForRawRequest: function() {
     var domain = App.currentDomain;
     var searchEndpoint = 'http://' + domain.endpoint + '/2011-02-01/search';
@@ -66,7 +69,7 @@ App.SearchController = Ember.ArrayController.extend({
         self.set('searched', true);
         self.set('resultsAvailable', data.hits.found > 0);
         self.set('numHits', data.hits.found);
-        self.set('numEnd', start + data.hits.found);
+        self.set('numReceived', data.hits.hit.length);
         var content = data.hits.hit.map(function(hit, index) {
           var pairs = [];
           jQuery.each(hit.data, function(columnName, value) {
-------------- next part --------------
HTML����������������������������...
Download 



More information about the Groonga-commit mailing list
Back to archive index