Make sure missing docs reroute back to all docs
Project: http://git-wip-us.apache.org/repos/asf/couchdb/repo Commit: http://git-wip-us.apache.org/repos/asf/couchdb/commit/843cc503 Tree: http://git-wip-us.apache.org/repos/asf/couchdb/tree/843cc503 Diff: http://git-wip-us.apache.org/repos/asf/couchdb/diff/843cc503 Branch: refs/heads/1960-paginate-all_dbs Commit: 843cc5030e2bad858b6c899223a3877986335470 Parents: ac9752d Author: suelockwood <[email protected]> Authored: Thu Jan 2 17:02:05 2014 -0500 Committer: suelockwood <[email protected]> Committed: Thu Jan 2 17:05:40 2014 -0500 ---------------------------------------------------------------------- src/fauxton/app/api.js | 6 ++++-- src/fauxton/app/modules/documents/views.js | 18 +++++------------- 2 files changed, 9 insertions(+), 15 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/couchdb/blob/843cc503/src/fauxton/app/api.js ---------------------------------------------------------------------- diff --git a/src/fauxton/app/api.js b/src/fauxton/app/api.js index 751cdd2..5ad032a 100644 --- a/src/fauxton/app/api.js +++ b/src/fauxton/app/api.js @@ -343,7 +343,8 @@ function(app, Fauxton) { var errorText = JSON.parse(resp.responseText).reason; FauxtonAPI.addNotification({ msg: 'An Error occurred: ' + errorText, - type: 'error' + type: 'error', + clear: true }); } @@ -355,7 +356,8 @@ function(app, Fauxton) { if (!resp) { return; } FauxtonAPI.addNotification({ msg: 'An Error occurred' + JSON.parse(resp.responseText).reason, - type: 'error' + type: 'error', + clear: true }); }); http://git-wip-us.apache.org/repos/asf/couchdb/blob/843cc503/src/fauxton/app/modules/documents/views.js ---------------------------------------------------------------------- diff --git a/src/fauxton/app/modules/documents/views.js b/src/fauxton/app/modules/documents/views.js index 8126f20..8f0a878 100644 --- a/src/fauxton/app/modules/documents/views.js +++ b/src/fauxton/app/modules/documents/views.js @@ -808,7 +808,8 @@ function(app, FauxtonAPI, Components, Documents, Databases, pouchdb, resizeColum establish: function() { var promise = this.model.fetch(), databaseId = this.database.safeID(), - deferred = $.Deferred(); + deferred = $.Deferred(), + that = this; promise.then(function () { deferred.resolve(); @@ -819,7 +820,7 @@ function(app, FauxtonAPI, Components, Documents, Databases, pouchdb, resizeColum type: 'error', clear: true }); - FauxtonAPI.navigate('/database/' + databaseId + '/_all_docs?limit=' + Databases.DocLimit); + that.goback(); } deferred.reject(); }); @@ -927,7 +928,7 @@ function(app, FauxtonAPI, Components, Documents, Databases, pouchdb, resizeColum }, cleanup: function () { - this.editor.remove(); + if (this.editor) this.editor.remove(); } }); @@ -1624,17 +1625,8 @@ function(app, FauxtonAPI, Components, Documents, Databases, pouchdb, resizeColum jumpToDoc: function (event) { event.preventDefault(); - var docId = this.$('#jump-to-doc-id').val().trim(); - - if (this.database.allDocs.where({"_id":docId}).length > 0){ - FauxtonAPI.navigate('/database/' + app.mixins.safeURLName(this.database.id) +'/' + app.mixins.safeURLName(docId), {trigger: true}); - } else { - FauxtonAPI.addNotification({ - msg: 'Document ID does not exist.', - type: 'error' - }); - } + FauxtonAPI.navigate('/database/' + app.mixins.safeURLName(this.database.id) +'/' + app.mixins.safeURLName(docId), {trigger: true}); }, afterRender: function () {
