[facet] duh ? jQuery crashes on facets with only one element. Strange that this is the first time we hit this bug
--- a/web/data/cubicweb.formfilter.js Fri May 29 21:30:19 2009 +0200
+++ b/web/data/cubicweb.formfilter.js Fri May 29 21:31:12 2009 +0200
@@ -143,7 +143,11 @@
}).length;
index += shift;
var parent = this.parentNode;
- jQuery(parent).find('.facetCheckBox:nth('+index+')').after(this);
+ var $insertAfter = jQuery(parent).find('.facetCheckBox:nth('+index+')');
+ if ( ! ($insertAfter.length == 1 && index == 0) ) {
+ // only rearrange element if necessary
+ $insertAfter.after(this);
+ }
} else {
var lastSelected = facet.find('.facetValueSelected:last');
if (lastSelected.length) {