// map all facets against selected, for simple rendering
var hash = $.deparam.fragment();
for (var key in hash) {
- if (key.indexOf('limit') == 0 && hash[key].indexOf(';'))
+ if (key.indexOf('limit') == 0) //always wrap in array
hash[key.substr(6)] = hash[key].split(';');
delete hash[key];
}
}
}
$('.mkdru-facet-' + facet).html(
- Drupal.theme('mkdruFacet', terms, facet, mkdru.facets[facet].max));
+ Drupal.theme('mkdruFacet', terms, facet, mkdru.facets[facet].max, hash));
}
};
if (term.selected) html += "</strong>";
html += '</a><span> (' + terms[i].freq
+ ')</span><br/>';
-
+ }
+ //TODO, meed to look up target name from ID
+ var sel = selections[facet];
+ if (terms.length == 0 && sel && sel.length) {
+ for (var i=0; i<sel.length; i++) {
+ if (sel[i]) {
+ html += '<a class="cross" href="'+mkdru.removeLimit(facet, sel[i])
+ + '"><strong>'+sel[i]+'</strong></a><span> (0)</span><br/>';
+ }
+ }
}
return html;
};