X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;f=src%2Fmkws-widget-facets.js;h=3e1ef5a315847b632c5ab07236000fc59980acb9;hb=4d27ecd86e4d2c7bad7d65062fc0a6e4745f7654;hp=d7c7ffa384f73cdc9d53651956f842decb0958c3;hpb=cb3027a4ef6f6cc32acd558f1a2585d14e223775;p=mkws-moved-to-github.git diff --git a/src/mkws-widget-facets.js b/src/mkws-widget-facets.js index d7c7ffa..3e1ef5a 100644 --- a/src/mkws-widget-facets.js +++ b/src/mkws-widget-facets.js @@ -4,11 +4,12 @@ mkws.registerWidgetType('facets', function() { var team = this.team; this.team.queue("searchtriggered").subscribe(function() { - var op = that.config['newsearch_opacity']; + var op = that.config.newsearch_opacity; if (op !== undefined) { that.node.fadeTo(500, op); } }); team.queue("facets").subscribe(function(data) { + that.node.stop(); that.node.css('opacity', 1); that.node.addClass("active"); }); @@ -45,23 +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, - field: data[i].id, count: data[i].freq, - linkdata: linkdata + href: '#' + team.urlFragment({ filters: fs }) }); } // configured template > facet specific template > default facet template