couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dav...@apache.org
Subject svn commit: r804255 - /couchdb/trunk/share/www/script/futon.browse.js
Date Fri, 14 Aug 2009 15:17:27 GMT
Author: davisp
Date: Fri Aug 14 15:17:23 2009
New Revision: 804255

URL: http://svn.apache.org/viewvc?rev=804255&view=rev
Log:
Fixes COUCHDB-429 - Error durring paging.

Patch by Jason Davies


Modified:
    couchdb/trunk/share/www/script/futon.browse.js

Modified: couchdb/trunk/share/www/script/futon.browse.js
URL: http://svn.apache.org/viewvc/couchdb/trunk/share/www/script/futon.browse.js?rev=804255&r1=804254&r2=804255&view=diff
==============================================================================
--- couchdb/trunk/share/www/script/futon.browse.js [utf-8] (original)
+++ couchdb/trunk/share/www/script/futon.browse.js [utf-8] Fri Aug 14 15:17:23 2009
@@ -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)))) {



Mime
View raw message