X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;f=src%2Fmkws-team.js;h=b02b441c32fc0b1aa6d4ff37fd71ab17c9baa765;hb=00225202a26b07fdcccf237e9302eefe686ad2a5;hp=7a9015e7b312ddc90a39be3677a92bf34ebe11dd;hpb=dd7ad194841702eeff011443e418b9e71a89cf39;p=mkws-moved-to-github.git diff --git a/src/mkws-team.js b/src/mkws-team.js index 7a9015e..b02b441 100644 --- a/src/mkws-team.js +++ b/src/mkws-team.js @@ -185,7 +185,9 @@ function team($, teamName) { that.limitCategory = function(id) { log("limitCategory(id=" + id + ")"); - m_filterSet.add(categoryFilter(id)); + // Only one category filter at a time + m_filterSet.removeMatching(function(f) { return f.type === 'category' }); + if (id !== '') m_filterSet.add(categoryFilter(id)); if (m_query) triggerSearch(); return false; }; @@ -249,7 +251,7 @@ function team($, teamName) { return; } - m_filterSet = filterSet(that); + m_filterSet.removeMatching(function(f) { return f.type !== 'category' }); triggerSearch(query, sortOrder, maxrecs, perpage, limit, targets, torusquery); switchView('records'); // In case it's configured to start off as hidden m_submitted = true; @@ -261,7 +263,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; @@ -270,9 +271,11 @@ function team($, teamName) { var pp2filter = m_filterSet.pp2filter(); var pp2limit = m_filterSet.pp2limit(limit); + var pp2catLimit = m_filterSet.pp2catLimit(); var params = {}; if (pp2limit) params.limit = pp2limit; + if (pp2catLimit) params.categoryfilter = pp2catLimit; if (maxrecs) params.maxrecs = maxrecs; if (torusquery) { if (!mkws.config.use_service_proxy)