couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From j..@apache.org
Subject [40/50] [abbrv] git commit: updated refs/heads/1684-feature-db-updates to ea07223
Date Mon, 22 Jul 2013 10:25:57 GMT
Fauxton: move log filtered collection to serialize


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

Branch: refs/heads/1684-feature-db-updates
Commit: 03d1b7e0c8c438d0a604c691575f9c7c15757004
Parents: 65e5074
Author: Garren Smith <garren.smith@gmail.com>
Authored: Tue Jul 9 15:29:49 2013 +0200
Committer: Garren Smith <garren.smith@gmail.com>
Committed: Tue Jul 9 15:29:49 2013 +0200

----------------------------------------------------------------------
 src/fauxton/app/addons/logs/resources.js | 15 ++++-----------
 1 file changed, 4 insertions(+), 11 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb/blob/03d1b7e0/src/fauxton/app/addons/logs/resources.js
----------------------------------------------------------------------
diff --git a/src/fauxton/app/addons/logs/resources.js b/src/fauxton/app/addons/logs/resources.js
index b64f813..072290b 100644
--- a/src/fauxton/app/addons/logs/resources.js
+++ b/src/fauxton/app/addons/logs/resources.js
@@ -97,10 +97,9 @@ function (app, FauxtonAPI, Backbone) {
       Log.events.on("log:remove", this.removeFilterLogs, this);
 
       this.filters = [];
-      this.filteredCollection = new Log.Collection(this.collection.toJSON());
 
       this.collection.on("add", function () {
-        this.createFilteredCollection();
+        this.render();
       }, this);
     },
 
@@ -109,7 +108,7 @@ function (app, FauxtonAPI, Backbone) {
     },
 
     serialize: function () {
-      return { logs: this.filteredCollection};
+      return { logs: new Log.Collection(this.createFilteredCollection())};
     },
 
     afterRender: function () {
@@ -122,18 +121,13 @@ function (app, FauxtonAPI, Backbone) {
 
     filterLogs: function (filter) {
       this.filters.push(filter);
-      this.createFilteredCollection();
-    },
-
-    resetFilterCollectionAndRender: function (logs) {
-      this.filteredCollection.reset(logs);
       this.render();
     },
 
     createFilteredCollection: function () {
       var that = this;
 
-      var filtered = _.reduce(this.filters, function (logs, filter) {
+      return _.reduce(this.filters, function (logs, filter) {
 
         return _.filter(logs, function (log) {
           var match = false;
@@ -149,12 +143,11 @@ function (app, FauxtonAPI, Backbone) {
 
       }, this.collection.toJSON(), this);
 
-      this.resetFilterCollectionAndRender(filtered);
     },
 
     removeFilterLogs: function (filter) {
       this.filters.splice(this.filters.indexOf(filter), 1);
-      this.createFilteredCollection();
+      this.render();
     },
 
     startRefreshInterval: function () {


Mime
View raw message