Commit ff53562f authored by Sven Franck's avatar Sven Franck

Fix/Paginations: set prev/next correctly for last item returned by allDocs

parent 626c6885
......@@ -14,9 +14,9 @@ define([
// TODO: this should receive the total number of results of a query/search!
priv.getPrevNextItem = function (arr, id, next, max) {
var step = next ? 1 : -1, position, id;
for (position = 1; position < max; position += 1) {
if (position === parseFloat(id)) {
for (position = 1; position <= max; position += 1) {
if (position === parseFloat(id)) {
// we have found the position in the array, get prev/next
if (next) {
if (arr[position] === undefined) {
......@@ -75,7 +75,6 @@ define([
// TODO: this is bad, because we can only point to doc_id, no matter what
// identifier we are setting. item_id itself is... bad... fix!
next = priv.getPrevNextItem(response.rows, currentId, true, response.total_rows);
if (!next) {
markup = params.source.replace("translate next", "translate next ui-state-disabled");
} else {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment