Reverse order of showDetails() arguments to match limitTarget() and
[mkws-moved-to-github.git] / tools / htdocs / mkws.js
index 52f8e73..c79c1e0 100644 (file)
@@ -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'
@@ -292,7 +292,7 @@ function team($, teamName) {
     {
        var template = loadTemplate("Summary");
        hit._id = "mkwsRec_" + hit.recid;
-       hit._onclick = "mkws.showDetails(this.id, '" + m_teamName + "');return false;"
+       hit._onclick = "mkws.showDetails('" + m_teamName + "', this.id);return false;"
        return template(hit);
     }
 
@@ -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 + '</a>'
                     + ' <span>' + data[i].freq + '</span>');
@@ -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 });
@@ -1381,7 +1381,7 @@ function _mkws_jquery_plugin ($) {
     };
 
 
-    mkws.showDetails = function (prefixRecId, tname) {
+    mkws.showDetails = function (tname, prefixRecId) {
        mkws.teams[tname].showDetails(prefixRecId);
     }
 
@@ -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 */