From: Jakub Skoczen Date: Tue, 8 Mar 2011 10:43:13 +0000 (+0100) Subject: Show/hide facet container when some/no facets X-Git-Url: http://lists.indexdata.dk/?a=commitdiff_plain;h=HEAD;p=mkdruding2.git Show/hide facet container when some/no facets --- 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