diff options
author | Paul Joseph Davis <davisp@apache.org> | 2009-08-14 15:17:23 +0000 |
---|---|---|
committer | Paul Joseph Davis <davisp@apache.org> | 2009-08-14 15:17:23 +0000 |
commit | dc26215a3a831d940f8590c9d1f359e7f2c27e68 (patch) | |
tree | a6fe512c924e0c9539ae779810e102041a1b1dd5 | |
parent | 6b574e7ad82ab7c9d5896cac7188677f6d71e09a (diff) |
Fixes COUCHDB-429 - Error durring paging.
Patch by Jason Davies
git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@804255 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r-- | share/www/script/futon.browse.js | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/share/www/script/futon.browse.js b/share/www/script/futon.browse.js index 7fa880fd..5a8b3fa7 100644 --- a/share/www/script/futon.browse.js +++ b/share/www/script/futon.browse.js @@ -509,10 +509,13 @@ resp.offset = 0; } var descending_reverse = ((options.descending && !descend) || (descend && (options.descending === false))); + var has_reduce_prev = resp.total_rows === undefined && (descending_reverse ? resp.rows.length > per_page : options.startkey !== undefined); if (descending_reverse && resp.rows) { resp.rows = resp.rows.reverse(); + if (resp.rows.length > per_page) { + resp.rows.push(resp.rows.shift()); + } } - var has_reduce_prev = resp.total_rows === undefined && (descending_reverse ? resp.rows.length > per_page : options.startkey !== undefined); if (resp.rows !== null && (has_reduce_prev || (descending_reverse ? (resp.total_rows - resp.offset > per_page) : (resp.offset > 0)))) { |