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 });
+ m_filterSet.removeMatching(function(f) { return f.type === 'target' });
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 });
+ m_filterSet.removeMatching(function(f) { return f.type == 'field' &&
+ field == f.field && value == f.value });
triggerSearch();
return false;
};