[facet] fix facet values update, broken by 7626:56300bec75f8
authorSylvain Thénault <sylvain.thenault@logilab.fr>
Thu, 07 Jul 2011 13:53:00 +0200
changeset 7628 56022cf13887
parent 7627 b837c1ca5009
child 7629 58f11f7dad68
[facet] fix facet values update, broken by 7626:56300bec75f8
web/data/cubicweb.facets.js
--- a/web/data/cubicweb.facets.js	Thu Jul 07 11:34:15 2011 +0200
+++ b/web/data/cubicweb.facets.js	Thu Jul 07 13:53:00 2011 +0200
@@ -1,7 +1,7 @@
 /** filter form, aka facets, javascript functions
  *
  *  :organization: Logilab
- *  :copyright: 2003-2010 LOGILAB S.A. (Paris, FRANCE), all rights reserved.
+ *  :copyright: 2003-2011 LOGILAB S.A. (Paris, FRANCE), all rights reserved.
  *  :contact: http://www.logilab.fr/ -- mailto:contact@logilab.fr
  */
 
@@ -110,9 +110,11 @@
 
         var d = loadRemote('json', ajaxFuncArgs('filter_select_content', null, toupdate, rql, mainvar));
         d.addCallback(function(updateMap) {
-            for (facetId in updateMap) {
-                var values = updateMap[facetId];
-                cw.jqNode(facetId).find('.facetCheckBox').each(function() {
+            for (facetName in updateMap) {
+                var values = updateMap[facetName];
+		// XXX fine with jquery 1.6
+                //$form.find('div[cubicweb\\:facetName="' + facetName + '"] ~ div .facetCheckBox').each(function() {
+                $form.find('div').filter(function () {return $(this).attr('cubicweb:facetName') == facetName}).parent().find('.facetCheckBox').each(function() {
                     var value = this.getAttribute('cubicweb:value');
                     if (jQuery.inArray(value, values) == -1) {
                         if (!jQuery(this).hasClass('facetValueDisabled')) {