From 450bc9c8c842c721174e733f74d20bfe6af2695e Mon Sep 17 00:00:00 2001 From: Jakub Skoczen Date: Tue, 8 Mar 2011 11:43:13 +0100 Subject: [PATCH] Show/hide facet container when some/no facets --- mkdruding2.js | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/mkdruding2.js b/mkdruding2.js index a8750d7..82af142 100644 --- a/mkdruding2.js +++ b/mkdruding2.js @@ -47,21 +47,28 @@ Drupal.theme.mkdruFacetContainer = function (facetsCfg) { var html = '

Facet browser

'; for (var i=0; i'; html += '
' html += ''+f.displayName +''; html += '
'; html += '
'; html += '
'; - html += '
' + html += ''; + html += '
'; } html += ''; return html; }; Drupal.theme.mkdruFacet = function (terms, facet, max, selections) { + jQuery('#mkdru-container-'+facet).hide(); var html = ""; + var show = false; for (var i = 0; i < terms.length && i < max; i++ ) { + show = true; var term = terms[i]; var id = term.name.split(/w+/).join("-").toLowerCase(); html += '
'; @@ -73,6 +80,7 @@ Drupal.theme.mkdruFacet = function (terms, facet, max, selections) { } if (terms.length == 0 && selections && selections.length) { for (var i=0; i