GitHub user willholley opened a pull request:
https://github.com/apache/couchdb/pull/168
Store the initial collection parameters to allow a safe reset to the first
page (COUCHDB-2187)
When adjusting page size, the desired behaviour is to navigate back to the
first page of the collection. This was previously achieved by parsing the
browser URL to get the query parameters but that does not capture additional
defaults that are set in JavaScript (such as reduce=false for views).
This commit adds 2 new methods to the document collections via a mixin:
saveDefaultParameters()
restoreDefaultParameters()
When each collection is initialized, we save the parameters which represent
the initial state - these can then be restored when the page size is changed.
Fixes COUCHDB-2187.
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/willholley/couchdb
2187-views-pagination-implicitly-applies-reduce-function
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/couchdb/pull/168.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #168
----
commit adf9ae25c6be1c654fededfc72350b48abfda1de
Author: Will Holley <[email protected]>
Date: 2014-03-07T10:16:19Z
Store the initial collection parameters to allow a safe reset to the first
page.
When adjusting page size, the desired behaviour is to navigate back to the
first page of the collection. This was previously done using the browser
URL but that does not capture additional defaults that are set in
JavaScript.
This commit adds 2 new methods to the document collections:
saveDefaultParameters()
restoreDefaultParameters()
When each collection is initialized, we save the parameters (which
represent the
initial state) - these can then be correctly restored when the page size is
changed.
Fixes COUCHDB-2187.
----
---
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.
---