Attempt to generate filter fragments that are a based on the
authorMike Taylor <mike@indexdata.com>
Mon, 11 May 2015 22:18:22 +0000 (23:18 +0100)
committerMike Taylor <mike@indexdata.com>
Mon, 11 May 2015 22:18:22 +0000 (23:18 +0100)
prevailing state.

This DOES NOT WORK due to an aliasing bug that I can make no sense
of. I'll discuss this with Jakub tomorrow.

src/mkws-widget-facets.js

index 3e1ef5a..5c720bd 100644 (file)
@@ -45,11 +45,17 @@ mkws.registerWidgetType('facet', function() {
     data = data[name];
     var terms = [];
     var teamName = team.name();
+    var base = team.filters();
+    var fs;
     for (var i = 0; i < data.length && i < max; i++) {
-      var fs = filterSet(team)
+      fs = $.extend(base, [], false);
+      //team.warn("fs = " + mkws.$.toJSON(fs));
+      //team.warn("team.filters = " + mkws.$.toJSON(team.filters()));
       if (!pzIndex) {
         // Special case: target selection
+        team.warn("before: team.filters = " + mkws.$.toJSON(team.filters()));
         fs.add(targetFilter(data[i].id, data[i].name));
+        team.warn("after: team.filters = " + mkws.$.toJSON(team.filters()));
       } else {
         fs.add(fieldFilter(pzIndex, data[i].name));
       }