From: Mike Taylor Date: Thu, 24 Apr 2014 10:26:03 +0000 (+0100) Subject: Switch on filter type, not presence of "id" field. X-Git-Tag: 1.0.0~858 X-Git-Url: http://jsfdemo.indexdata.com/cgi-bin?a=commitdiff_plain;h=0e5fc9c87c4a2c8d3cecaa0e389bd2f4d8ccea28;p=mkws-moved-to-github.git Switch on filter type, not presence of "id" field. --- diff --git a/src/mkws-team.js b/src/mkws-team.js index 2e24854..d99370d 100644 --- a/src/mkws-team.js +++ b/src/mkws-team.js @@ -193,7 +193,7 @@ function team($, teamName) { 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; }; @@ -201,7 +201,8 @@ function team($, teamName) { 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; };