# HG changeset patch # User Sylvain Thénault # Date 1310039580 -7200 # Node ID 56022cf138878297d07864321c2bc67d78d912c4 # Parent b837c1ca5009b8897d19eddac9f18845fceaf9b7 [facet] fix facet values update, broken by 7626:56300bec75f8 diff -r b837c1ca5009 -r 56022cf13887 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')) {