merge 3.0
authorsylvain.thenault@logilab.fr
Thu, 15 Jan 2009 15:59:35 +0100
branch3.0
changeset 435 7c19ba5bfbbb
parent 433 95cb5b6e15c6 (current diff)
parent 434 915b4c6ffe5e (diff)
child 436 0e4fb0a257ab
merge
--- a/web/data/cubicweb.formfilter.js	Thu Jan 15 15:59:08 2009 +0100
+++ b/web/data/cubicweb.formfilter.js	Thu Jan 15 15:59:35 2009 +0100
@@ -109,10 +109,9 @@
     root = root || document;
     jQuery(root).find('form').each(function () {
 	var form = jQuery(this);
-	var facetargs = form.attr('cubicweb:facetargs');
-	if (facetargs) {
+	var facetargs = evalJSON(form.attr('cubicweb:facetargs'));
+	if (facetargs !== undefined && facetargs.length) {
 	    form.submit(function() {
-		var facetargs = evalJSON(form.attr('cubicweb:facetargs'));
 	        buildRQL.apply(null, facetargs); //(divid, vid, paginate, extraargs);
 	        return false;
 	    });
@@ -122,7 +121,6 @@
 		    this.setAttribute('cubicweb:idx', i);
 		});
 		facet.find('div.facetCheckBox').click(function () {
-		    var facetargs = evalJSON(form.attr('cubicweb:facetargs'));
 		    var $this = jQuery(this);
 		    if ($this.hasClass('facetValueSelected')) {
 			$this.removeClass('facetValueSelected');