couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From robertkowal...@apache.org
Subject fauxton commit: updated refs/heads/master to b245c6d
Date Tue, 15 Nov 2016 14:00:20 GMT
Repository: couchdb-fauxton
Updated Branches:
  refs/heads/master 89f57a453 -> b245c6d20


db-list: expose elements to make them reusable

PR: #806
PR-URL: https://github.com/apache/couchdb-fauxton/pull/806
Reviewed-By: Ryan Millay


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

Branch: refs/heads/master
Commit: b245c6d20376fd29159004b792dcea42639bcf00
Parents: 89f57a4
Author: Robert Kowalski <robertkowalski@apache.org>
Authored: Fri Nov 11 16:57:42 2016 +0100
Committer: Robert Kowalski <robertkowalski@apache.org>
Committed: Tue Nov 15 15:00:19 2016 +0100

----------------------------------------------------------------------
 app/addons/databases/components.react.jsx | 16 +++++++++++-----
 app/addons/databases/stores.js            |  7 ++++---
 2 files changed, 15 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/b245c6d2/app/addons/databases/components.react.jsx
----------------------------------------------------------------------
diff --git a/app/addons/databases/components.react.jsx b/app/addons/databases/components.react.jsx
index 5e58681..849f284 100644
--- a/app/addons/databases/components.react.jsx
+++ b/app/addons/databases/components.react.jsx
@@ -296,14 +296,17 @@ var DatabasePagination = React.createClass({
 
   getDefaultProps: function () {
     return {
-      linkPath: '_all_dbs'
+      linkPath: '_all_dbs',
+      store: databasesStore
     };
   },
 
   getStoreState: function () {
+    const {store} = this.props;
+
     return {
-      totalAmountOfDatabases: databasesStore.getTotalAmountOfDatabases(),
-      page: databasesStore.getPage()
+      totalAmountOfDatabases: store.getTotalAmountOfDatabases(),
+      page: store.getPage()
     };
   },
 
@@ -312,11 +315,14 @@ var DatabasePagination = React.createClass({
   },
 
   componentDidMount: function () {
-    databasesStore.on('change', this.onChange, this);
+    const {store} = this.props;
+
+    store.on('change', this.onChange, this);
   },
 
   componentWillUnmount: function () {
-    databasesStore.off('change', this.onChange, this);
+    const {store} = this.props;
+    store.off('change', this.onChange, this);
   },
 
   onChange: function () {

http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/b245c6d2/app/addons/databases/stores.js
----------------------------------------------------------------------
diff --git a/app/addons/databases/stores.js b/app/addons/databases/stores.js
index e0145a2..ff75d01 100644
--- a/app/addons/databases/stores.js
+++ b/app/addons/databases/stores.js
@@ -18,7 +18,7 @@ import Helpers from "../../helpers";
 
 const Database = Resources.Model;
 
-var DatabasesStore = FauxtonAPI.Store.extend({
+const DatabasesStoreConstructor = FauxtonAPI.Store.extend({
 
   initialize: function () {
     this.reset();
@@ -134,9 +134,10 @@ var DatabasesStore = FauxtonAPI.Store.extend({
   }
 });
 
-const databasesStore = new DatabasesStore();
+const databasesStore = new DatabasesStoreConstructor();
 databasesStore.dispatchToken = FauxtonAPI.dispatcher.register(databasesStore.dispatch.bind(databasesStore));
 
 export default {
-  databasesStore: databasesStore
+  databasesStore: databasesStore,
+  DatabasesStoreConstructor: DatabasesStoreConstructor
 };


Mime
View raw message