You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@couchdb.apache.org by ga...@apache.org on 2014/01/08 09:50:38 UTC
git commit: updated refs/heads/fauxton-pagination to 8ae3b11
Updated Branches:
refs/heads/fauxton-pagination 66ac67f36 -> 8ae3b11f6
More improvement and fixes
Project: http://git-wip-us.apache.org/repos/asf/couchdb/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb/commit/8ae3b11f
Tree: http://git-wip-us.apache.org/repos/asf/couchdb/tree/8ae3b11f
Diff: http://git-wip-us.apache.org/repos/asf/couchdb/diff/8ae3b11f
Branch: refs/heads/fauxton-pagination
Commit: 8ae3b11f65a0a264f5a0fcf0439c1b7ddf6f651c
Parents: 66ac67f
Author: Garren Smith <ga...@gmail.com>
Authored: Wed Jan 8 10:50:20 2014 +0200
Committer: Garren Smith <ga...@gmail.com>
Committed: Wed Jan 8 10:50:20 2014 +0200
----------------------------------------------------------------------
src/fauxton/app/modules/documents/resources.js | 8 +++++++-
src/fauxton/app/modules/documents/routes.js | 2 ++
src/fauxton/app/modules/documents/views.js | 7 ++++++-
src/fauxton/app/modules/fauxton/components.js | 3 +--
4 files changed, 16 insertions(+), 4 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/couchdb/blob/8ae3b11f/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 d355671..43bb0fd 100644
--- a/src/fauxton/app/modules/documents/resources.js
+++ b/src/fauxton/app/modules/documents/resources.js
@@ -435,7 +435,11 @@ function(app, FauxtonAPI) {
lastDoc = this.last();
}
- this.params.startkey_docid = lastDoc.get("id");
+ var id = lastDoc.get("id");
+ if (id) {
+ this.params.startkey_docid = id;
+ }
+
this.params.startkey = JSON.stringify(lastDoc.get('key'));
this.params.limit = num + 1;
return this.url('app');
@@ -465,6 +469,8 @@ function(app, FauxtonAPI) {
},
totalRows: function() {
+ if (this.params.reduce) { return "unknown_reduce";}
+
return this.viewMeta.total_rows || "unknown";
},
http://git-wip-us.apache.org/repos/asf/couchdb/blob/8ae3b11f/src/fauxton/app/modules/documents/routes.js
----------------------------------------------------------------------
diff --git a/src/fauxton/app/modules/documents/routes.js b/src/fauxton/app/modules/documents/routes.js
index 493f892..fdd731d 100644
--- a/src/fauxton/app/modules/documents/routes.js
+++ b/src/fauxton/app/modules/documents/routes.js
@@ -252,6 +252,7 @@ function(app, FauxtonAPI, Documents, Databases) {
if (this.toolsView) { this.toolsView.remove(); }
+ console.log('showing');
this.documentsView = this.setView("#dashboard-lower-content", new Documents.Views.AllDocsList({
database: this.data.database,
collection: this.data.indexedDocs,
@@ -311,6 +312,7 @@ function(app, FauxtonAPI, Documents, Databases) {
params: app.getParams()
});
+ this.documentsView && this.documentsView.remove();
this.documentsView = this.setView("#dashboard-lower-content", new Documents.Views.AllDocsList({
database: this.data.database,
collection: this.data.indexedDocs,
http://git-wip-us.apache.org/repos/asf/couchdb/blob/8ae3b11f/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 32f63a2..f598f72 100644
--- a/src/fauxton/app/modules/documents/views.js
+++ b/src/fauxton/app/modules/documents/views.js
@@ -653,7 +653,6 @@ function(app, FauxtonAPI, Components, Documents, Databases, pouchdb, resizeColum
});
model.collection.remove(model.id);
- console.log(model.id.match('_design'), !!model.id.match('_design'));
if (!!model.id.match('_design')) {
FauxtonAPI.triggerRouteEvent('reloadDesignDocs');
}
@@ -696,6 +695,12 @@ function(app, FauxtonAPI, Components, Documents, Databases, pouchdb, resizeColum
}
});
},
+
+ cleanup: function () {
+ this.pagination.remove();
+ this.allDocsNumber.remove();
+ _.each(this.rows, function (row) {row.remove();});
+ },
beforeRender: function() {
var showNumbers = true;
http://git-wip-us.apache.org/repos/asf/couchdb/blob/8ae3b11f/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 65ced15..b2db6e0 100644
--- a/src/fauxton/app/modules/fauxton/components.js
+++ b/src/fauxton/app/modules/fauxton/components.js
@@ -60,8 +60,6 @@ function(app, FauxtonAPI, ace) {
"click a#previous": 'previousClicked'
},
- previousParams: [],
-
scrollTo: function () {
if (!this.scrollToSelector) { return; }
$(this.scrollToSelector).animate({ scrollTop: 0 }, 'slow');
@@ -74,6 +72,7 @@ function(app, FauxtonAPI, ace) {
this.canShowNextfn = options.canShowNextfn;
this.scrollToSelector = options.scrollToSelector;
_.bindAll(this);
+ this.previousParams = [];
},
previousClicked: function (event) {