Github user deathbearbrown commented on a diff in the pull request:

    https://github.com/apache/couchdb/pull/162#discussion_r10220337
  
    --- Diff: src/fauxton/app/addons/documents/routes.js ---
    @@ -345,14 +376,62 @@ function(app, FauxtonAPI, Documents, Databases) {
           }));
         },
     
    -    paginate: function (direction) {
    -      _.extend(this.documentsView.collection.params, app.getParams());
    +    perPageChange: function (perPage) {
    +      var params = app.getParams();
    +      this.perPage = perPage;
    +      this.documentsView.updatePerPage(perPage);
    +      this.documentsView.forceRender();
    +      params.limit = perPage;
    +      this.documentsView.collection.params = params;
    +      this.setDocPerPageLimit(perPage);
    +    },
    +
    +    paginate: function (options) {
    +      var params = {},
    +          urlParams = app.getParams(),
    +          collection = this.documentsView.collection;
    +
           this.documentsView.forceRender();
    -      if (direction === 'next') {
    -        this.documentsView.collection.skipFirstItem = true;
    +      var rawCollection = collection.map(function (item) { return 
item.toJSON(); });
    +
    +      // this is really ugly. But we basically need to make sure that
    +      // all parameters are in the correct state and have been parsed 
before we
    +      // calculate how to paginate the collection
    +      _.each(['startkey', 'endkey', 'key'], function (key) {
    --- End diff --
    
    can you pull this out into it's own function?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

Reply via email to