var html = '<h2>Facet browser</h2><div class="content">';
for (var i=0; i<fs.length; i++) {
var f = fs[i];
+ //not display
+ html += '<div id="mkdru-container-'+f.originalKey
+ +'" style="display: none;">';
html += '<fieldset class="form-wrapper">'
html += '<legend><span class="fieldset-legend">'+f.displayName
+'</span></legend>';
html += '<div class="fieldset-wrapper">';
html += '<div class="mkdru-facet-'+f.originalKey+' form-checkboxes"/>';
html += '</div>';
- html += '</fieldset>'
+ html += '</fieldset>';
+ html += '</div>';
}
html += '</div>';
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 += '<div class="form-item form-type-checkbox">';
}
if (terms.length == 0 && selections && selections.length) {
for (var i=0; i<selections.length; i++) {
+ show = true;
if (selections[i]) {
// since we have no target name (only id) go for the basename
// FIXME get the proper target name
}
}
}
+ if (show) jQuery('#mkdru-container-'+facet).show();
return html;
};