From: Mike Taylor Date: Thu, 24 Apr 2014 10:35:55 +0000 (+0100) Subject: All limit/delimit invocations of triggerSearch fire only if there's a query. X-Git-Tag: 1.0.0~855 X-Git-Url: http://git.indexdata.com/?p=mkws-moved-to-github.git;a=commitdiff_plain;h=dd7ad194841702eeff011443e418b9e71a89cf39 All limit/delimit invocations of triggerSearch fire only if there's a query. --- diff --git a/src/mkws-team.js b/src/mkws-team.js index 4c59bec..7a9015e 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,7 +178,7 @@ 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; }; @@ -194,7 +194,7 @@ function team($, teamName) { that.delimitTarget = function(id) { log("delimitTarget(id=" + id + ")"); m_filterSet.removeMatching(function(f) { return f.type === 'target' }); - triggerSearch(); + if (m_query) triggerSearch(); return false; }; @@ -203,7 +203,7 @@ function team($, teamName) { log("delimitQuery(field=" + field + ", value=" + value + ")"); m_filterSet.removeMatching(function(f) { return f.type == 'field' && field == f.field && value == f.value }); - triggerSearch(); + if (m_query) triggerSearch(); return false; };