From a0495c501ec76cd2cbb99f0934d9b5106ed97413 Mon Sep 17 00:00:00 2001 From: Mike Taylor Date: Fri, 7 Feb 2014 15:05:31 +0000 Subject: [PATCH] mkws.limitQuery() now accepts a team-name and delegates to the appropriate team's member-function of the same name. --- tools/htdocs/mkws.js | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/tools/htdocs/mkws.js b/tools/htdocs/mkws.js index 52f8e73..980a5d2 100644 --- a/tools/htdocs/mkws.js +++ b/tools/htdocs/mkws.js @@ -67,7 +67,7 @@ Handlebars.registerHelper('commaList', function(items, options) { // Some functions are visible to be called from outside code, namely -// generated HTML: mkws.switchView(), showDetails(), limitTarget(), +// generated HTML: that.switchView(), showDetails(), limitTarget(), // limitQuery(), delimitTarget(), delimitQuery(), pagerPrev(), // pagerNext(), showPage(). Also mkws.M() is made available for the // Handlebars helper 'translate' @@ -358,7 +358,7 @@ function team($, teamName) { acc.push('target_id='+data[i].id+' '); action = 'mkws.limitTarget(\'' + m_teamName + '\', this.getAttribute(\'target_id\'),this.firstChild.nodeValue)'; } else { - action = 'mkws.limitQuery(\'' + pzIndex + '\', this.firstChild.nodeValue)'; + action = 'mkws.limitQuery(\'' + m_teamName + '\', \'' + pzIndex + '\', this.firstChild.nodeValue)'; } acc.push('onclick="' + action + ';return false;">' + data[i].name + '' + ' ' + data[i].freq + ''); @@ -543,7 +543,7 @@ function team($, teamName) { // limit the query after clicking the facet - mkws.limitQuery = function (field, value) + that.limitQuery = function (field, value) { debug("limitQuery(field=" + field + ", value=" + value + ")"); m_filters.push({ field: field, value: value }); @@ -1389,6 +1389,10 @@ function _mkws_jquery_plugin ($) { mkws.teams[tname].limitTarget(id, name); } + mkws.limitQuery = function (tname, field, value) { + mkws.teams[tname].limitQuery(field, value); + } + function default_mkws_config() { /* default mkws config */ -- 1.7.10.4