From 00225202a26b07fdcccf237e9302eefe686ad2a5 Mon Sep 17 00:00:00 2001 From: Mike Taylor Date: Thu, 24 Apr 2014 12:45:11 +0100 Subject: [PATCH] Remove any old category filters when setting a new one. The special empty category-id means not to use a filter at all. --- src/mkws-team.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/mkws-team.js b/src/mkws-team.js index 8d33d9e..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; }; -- 1.7.10.4