couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From deathb...@apache.org
Subject git commit: updated refs/heads/master to e4f6d42
Date Tue, 17 Dec 2013 17:39:07 GMT
Updated Branches:
  refs/heads/master fe888d2f9 -> e4f6d4293


Fixing database landing page so that it doesn't fetch the status of every database on load.
Only fetches the # of databases showing per page.


Project: http://git-wip-us.apache.org/repos/asf/couchdb/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb/commit/e4f6d429
Tree: http://git-wip-us.apache.org/repos/asf/couchdb/tree/e4f6d429
Diff: http://git-wip-us.apache.org/repos/asf/couchdb/diff/e4f6d429

Branch: refs/heads/master
Commit: e4f6d429322eb940a04ab0dff6ba7897fa25f4e3
Parents: fe888d2
Author: suelockwood <deathbear@apache.org>
Authored: Thu Dec 12 16:14:10 2013 -0500
Committer: suelockwood <deathbear@apache.org>
Committed: Tue Dec 17 12:36:19 2013 -0500

----------------------------------------------------------------------
 src/fauxton/app/modules/databases/routes.js | 15 +--------------
 src/fauxton/app/modules/databases/views.js  | 18 ++++++++++++++++--
 2 files changed, 17 insertions(+), 16 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb/blob/e4f6d429/src/fauxton/app/modules/databases/routes.js
----------------------------------------------------------------------
diff --git a/src/fauxton/app/modules/databases/routes.js b/src/fauxton/app/modules/databases/routes.js
index ac50b4b..e63c3a7 100644
--- a/src/fauxton/app/modules/databases/routes.js
+++ b/src/fauxton/app/modules/databases/routes.js
@@ -59,20 +59,7 @@ function(app, FauxtonAPI, Databases, Views) {
     },
 
     establish: function() {
-      var databases = this.databases;
-      var deferred = this.deferred;
-
-      databases.fetch().done(function(resp) {
-        FauxtonAPI.when(databases.map(function(database) {
-          return database.status.fetch();
-        })).always(function(resp) {
-          //make this always so that even if a user is not allowed access to a database
-          //they will still see a list of all databases
-          deferred.resolve();
-        });
-      });
-
-      return [deferred];
+     return [this.databases.fetch()];
     }
   });
 

http://git-wip-us.apache.org/repos/asf/couchdb/blob/e4f6d429/src/fauxton/app/modules/databases/views.js
----------------------------------------------------------------------
diff --git a/src/fauxton/app/modules/databases/views.js b/src/fauxton/app/modules/databases/views.js
index 7d59ac4..02b0297 100644
--- a/src/fauxton/app/modules/databases/views.js
+++ b/src/fauxton/app/modules/databases/views.js
@@ -24,7 +24,9 @@ function(app, Components, FauxtonAPI, Databases) {
   Views.Item = FauxtonAPI.View.extend({
     template: "templates/databases/item",
     tagName: "tr",
-
+    establish: function(){
+      return [this.model.fetch()];
+    },
     serialize: function() {
       return {
         encoded: encodeURIComponent(this.model.get("name")),
@@ -54,7 +56,19 @@ function(app, Components, FauxtonAPI, Databases) {
         databases: this.collection
       };
     },
-
+    establish: function(){
+      var currentDBs = this.paginated();
+      var deferred = FauxtonAPI.Deferred();
+
+      FauxtonAPI.when(currentDBs.map(function(database) {
+        return database.status.fetch();
+      })).always(function(resp) {
+        //make this always so that even if a user is not allowed access to a database
+        //they will still see a list of all databases
+        deferred.resolve();
+      });
+      return [deferred];
+    },
     switchDatabase: function(event, selectedName) {
       event && event.preventDefault();
 


Mime
View raw message