X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;f=src%2Fmkws-team.js;h=5a2563b1888d3cca27658925676832e52dd96f96;hb=f5ad3c3d45025f21e346a4fa343d0473a9cb4b39;hp=2e2485462ca3ae5574abb3a385e801ef556bda85;hpb=b3ad811d9b8569c4bc5a05c9150aa77a89dc27aa;p=mkws-moved-to-github.git diff --git a/src/mkws-team.js b/src/mkws-team.js index 2e24854..5a2563b 100644 --- a/src/mkws-team.js +++ b/src/mkws-team.js @@ -170,7 +170,7 @@ function team($, teamName) { that.limitTarget = function(id, name) { log("limitTarget(id=" + id + ", name=" + name + ")"); m_filterSet.add(targetFilter(id, name)); - triggerSearch(); + if (m_query) triggerSearch(); return false; }; @@ -178,31 +178,32 @@ function team($, teamName) { that.limitQuery = function(field, value) { log("limitQuery(field=" + field + ", value=" + value + ")"); m_filterSet.add(fieldFilter(field, value)); - triggerSearch(); + if (m_query) triggerSearch(); return false; }; that.limitCategory = function(id) { log("limitCategory(id=" + id + ")"); - // ### Add a filter - // ### triggerSearch() if there's a query + m_filterSet.add(categoryFilter(id)); + if (m_query) triggerSearch(); return false; }; that.delimitTarget = function(id) { log("delimitTarget(id=" + id + ")"); - m_filterSet.removeMatching(function(f) { return f.id }); - triggerSearch(); + m_filterSet.removeMatching(function(f) { return f.type === 'target' }); + if (m_query) triggerSearch(); return false; }; that.delimitQuery = function(field, value) { log("delimitQuery(field=" + field + ", value=" + value + ")"); - m_filterSet.removeMatching(function(f) { return f.field && field == f.field && value == f.value }); - triggerSearch(); + m_filterSet.removeMatching(function(f) { return f.type == 'field' && + field == f.field && value == f.value }); + if (m_query) triggerSearch(); return false; }; @@ -260,7 +261,6 @@ function team($, teamName) { resetPage(); queue("navi").publish(); - // Continue to use previous query/sort-order unless new ones are specified if (query) m_query = query; if (sortOrder) m_sortOrder = sortOrder;