Use m_filterSet.pp2limit method instead of building by hand.
authorMike Taylor <mike@indexdata.com>
Wed, 23 Apr 2014 14:38:31 +0000 (15:38 +0100)
committerMike Taylor <mike@indexdata.com>
Wed, 23 Apr 2014 14:38:31 +0000 (15:38 +0100)
src/mkws-team.js

index b3cb0c4..0824618 100644 (file)
@@ -260,7 +260,6 @@ function team($, teamName) {
        resetPage();
        queue("navi").publish();
 
-       var pp2limit = limit || "";
 
        // Continue to use previous query/sort-order unless new ones are specified
        if (query) {
@@ -277,14 +276,7 @@ function team($, teamName) {
        }
 
        var pp2filter = m_filterSet.pp2filter();
-       for (var i in m_filterSet.list()) {
-           var filter = m_filterSet.list()[i];
-           if (!filter.id) {
-               if (pp2limit)
-                   pp2limit += ",";
-               pp2limit += filter.field + "=" + filter.value.replace(/[\\|,]/g, '\\$&');
-           }
-       }
+       var pp2limit = m_filterSet.pp2limit(limit);
 
        var params = {};
        if (pp2limit) {