couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gar...@apache.org
Subject [32/47] couchdb commit: updated refs/heads/Update-Sidebar-Ui to c173e52
Date Mon, 19 May 2014 16:17:50 GMT
Fauxton: fix sorting for tasks on click

there is no node property, but a target, source or database
depending on the task


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

Branch: refs/heads/Update-Sidebar-Ui
Commit: 2fe69e704bf3520334082a03fcf07434eda44ea0
Parents: cf90e09
Author: Robert Kowalski <rok@kowalski.gd>
Authored: Fri Apr 25 23:53:56 2014 +0200
Committer: Robert Kowalski <rok@kowalski.gd>
Committed: Wed May 7 19:06:04 2014 +0200

----------------------------------------------------------------------
 src/fauxton/app/addons/activetasks/resources.js     | 16 ++++++++++++++--
 .../app/addons/activetasks/templates/table.html     |  2 +-
 2 files changed, 15 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb/blob/2fe69e70/src/fauxton/app/addons/activetasks/resources.js
----------------------------------------------------------------------
diff --git a/src/fauxton/app/addons/activetasks/resources.js b/src/fauxton/app/addons/activetasks/resources.js
index 3ac0898..3c5a513 100644
--- a/src/fauxton/app/addons/activetasks/resources.js
+++ b/src/fauxton/app/addons/activetasks/resources.js
@@ -23,7 +23,7 @@ function (app, backbone, Fauxton) {
       app.taskSortBy = 'type';
 
   Active.Task = Backbone.Model.extend({
-    initialize: function() { 
+    initialize: function() {
       this.set({"id": this.get('pid')});
     }
   });
@@ -109,7 +109,19 @@ function (app, backbone, Fauxton) {
       this.sort();
     },
     comparator: function(item) {
-      return item.get(app.taskSortBy);
+      var value = app.taskSortBy,
+          values;
+
+      if (value.indexOf(',') !== -1) {
+        values = value.split(',');
+        _.each(values, function (val) {
+          if (item.get(val)) {
+            value = val;
+          }
+        });
+      }
+
+      return item.get(value);
     }
   });
 

http://git-wip-us.apache.org/repos/asf/couchdb/blob/2fe69e70/src/fauxton/app/addons/activetasks/templates/table.html
----------------------------------------------------------------------
diff --git a/src/fauxton/app/addons/activetasks/templates/table.html b/src/fauxton/app/addons/activetasks/templates/table.html
index 885cb47..77d2a42 100644
--- a/src/fauxton/app/addons/activetasks/templates/table.html
+++ b/src/fauxton/app/addons/activetasks/templates/table.html
@@ -37,7 +37,7 @@ the License.
   <thead>
     <tr>
       <th data-type="type">Type</th>
-      <th data-type="node">Object</th>
+      <th data-type="source,target,database">Object</th>
       <th data-type="started_on">Started on</th>
       <th data-type="updated_on">Last updated on</th>
       <th data-type="pid">PID</th>


Mime
View raw message