From c301a8ec45a4eb2afab898a57887a61693f1a21d Mon Sep 17 00:00:00 2001 From: Mike Taylor Date: Fri, 8 May 2015 23:50:13 +0100 Subject: [PATCH] Facet widgets now generate HREFs with facet data in fragments instead of actions. --- src/mkws-widget-facets.js | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/src/mkws-widget-facets.js b/src/mkws-widget-facets.js index 27ddc34..3e1ef5a 100644 --- a/src/mkws-widget-facets.js +++ b/src/mkws-widget-facets.js @@ -46,22 +46,17 @@ mkws.registerWidgetType('facet', function() { var terms = []; var teamName = team.name(); for (var i = 0; i < data.length && i < max; i++) { - var linkdata = ""; - var action = ""; + var fs = filterSet(team) if (!pzIndex) { // Special case: target selection - linkdata += ('target_id='+data[i].id+' '); - if (!team.targetFiltered(data[i].id)) { - action = 'mkws.limitTarget(\'' + teamName + '\', this.getAttribute(\'target_id\'),this.firstChild.nodeValue)'; - } + fs.add(targetFilter(data[i].id, data[i].name)); } else { - action = 'mkws.limitQuery(\'' + teamName + '\', \'' + pzIndex + '\', this.firstChild.nodeValue)'; + fs.add(fieldFilter(pzIndex, data[i].name)); } - linkdata += 'onclick="' + action + ';return false;"'; terms.push({ term: data[i].name, count: data[i].freq, - linkdata: linkdata + href: '#' + team.urlFragment({ filters: fs }) }); } // configured template > facet specific template > default facet template -- 1.7.10.4