Updated Branches: refs/heads/1760-fauxton-correct-row-message 4aa8955ca -> 29389322d
Fix bug when delete all docs on page Project: http://git-wip-us.apache.org/repos/asf/couchdb/repo Commit: http://git-wip-us.apache.org/repos/asf/couchdb/commit/29389322 Tree: http://git-wip-us.apache.org/repos/asf/couchdb/tree/29389322 Diff: http://git-wip-us.apache.org/repos/asf/couchdb/diff/29389322 Branch: refs/heads/1760-fauxton-correct-row-message Commit: 29389322defc6c950be2f8bdd424f289749e9847 Parents: 4aa8955 Author: Garren Smith <[email protected]> Authored: Fri Oct 11 12:03:50 2013 +0200 Committer: Garren Smith <[email protected]> Committed: Fri Oct 11 12:03:50 2013 +0200 ---------------------------------------------------------------------- src/fauxton/app/modules/documents/resources.js | 8 +++++++- src/fauxton/app/modules/fauxton/components.js | 7 ++++++- 2 files changed, 13 insertions(+), 2 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/couchdb/blob/29389322/src/fauxton/app/modules/documents/resources.js ---------------------------------------------------------------------- diff --git a/src/fauxton/app/modules/documents/resources.js b/src/fauxton/app/modules/documents/resources.js index 4f75daa..f80aeef 100644 --- a/src/fauxton/app/modules/documents/resources.js +++ b/src/fauxton/app/modules/documents/resources.js @@ -278,7 +278,13 @@ function(app, FauxtonAPI) { urlNextPage: function (num, lastId) { if (!lastId) { - lastId = this.last().id; + var doc = this.last(); + + if (doc) { + lastId = doc.id; + } else { + lastId = ''; + } } this.params.startkey_docid = '"' + lastId + '"'; http://git-wip-us.apache.org/repos/asf/couchdb/blob/29389322/src/fauxton/app/modules/fauxton/components.js ---------------------------------------------------------------------- diff --git a/src/fauxton/app/modules/fauxton/components.js b/src/fauxton/app/modules/fauxton/components.js index 09dcc51..03fea87 100644 --- a/src/fauxton/app/modules/fauxton/components.js +++ b/src/fauxton/app/modules/fauxton/components.js @@ -73,7 +73,12 @@ function(app, FauxtonAPI) { nextClicked: function (event) { event.preventDefault(); - this.previousIds.push(this.collection.first().id); + var doc = this.collection.first(); + + if (doc) { + this.previousIds.push(doc.id); + } + FauxtonAPI.navigate(this.nextUrlfn(), {trigger: false}); FauxtonAPI.triggerRouteEvent('paginate', 'next'); },
