From c539df1fd08f6cffc82593ba253e7eba99c7b9cd Mon Sep 17 00:00:00 2001 From: Mike Taylor Date: Fri, 7 Feb 2014 15:02:06 +0000 Subject: [PATCH] redraw_navi() made team-aware. Facet divs made team-specific. mkws.limitTarget() now accepts a team-name and delegates to the appropriate team's member-function of the same name. --- tools/htdocs/mkws.js | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/tools/htdocs/mkws.js b/tools/htdocs/mkws.js index 815eaa7..52f8e73 100644 --- a/tools/htdocs/mkws.js +++ b/tools/htdocs/mkws.js @@ -347,7 +347,7 @@ function team($, teamName) { function add_single_facet(acc, caption, data, max, pzIndex) { - acc.push('
'); + acc.push('
'); acc.push('
' + M(caption) + '
'); for (var i = 0; i < data.length && i < max; i++) { acc.push('
'); @@ -356,7 +356,7 @@ function team($, teamName) { if (!pzIndex) { // Special case: target selection acc.push('target_id='+data[i].id+' '); - action = 'mkws.limitTarget(this.getAttribute(\'target_id\'),this.firstChild.nodeValue)'; + action = 'mkws.limitTarget(\'' + m_teamName + '\', this.getAttribute(\'target_id\'),this.firstChild.nodeValue)'; } else { action = 'mkws.limitQuery(\'' + pzIndex + '\', this.firstChild.nodeValue)'; } @@ -457,7 +457,7 @@ function team($, teamName) { } m_filters = [] - redraw_navi(); // ### should use windowid + redraw_navi(); resetPage(); // ### the globals it resents should be indexed by windowid loadSelect(); // ### should use windowid triggerSearch(query, sort, targets, windowid); @@ -556,7 +556,7 @@ function team($, teamName) { // limit by target functions - mkws.limitTarget = function (id, name) + that.limitTarget = function (id, name) { debug("limitTarget(id=" + id + ", name=" + name + ")"); m_filters.push({ id: id, name: name }); @@ -618,7 +618,7 @@ function team($, teamName) { function redraw_navi () { - var navi = document.getElementById('mkwsNavi'); + var navi = $('.mkwsNavi.mkwsTeam_' + m_teamName); if (!navi) return; var text = ""; @@ -637,7 +637,7 @@ function team($, teamName) { } } - navi.innerHTML = text; + navi.html(text); } @@ -1385,6 +1385,10 @@ function _mkws_jquery_plugin ($) { mkws.teams[tname].showDetails(prefixRecId); } + mkws.limitTarget = function (tname, id, name) { + mkws.teams[tname].limitTarget(id, name); + } + function default_mkws_config() { /* default mkws config */ -- 1.7.10.4