Minor cleanup.
[mkdru-moved-to-drupal.org.git] / mkdru.theme.js
index 5af43ee..229c482 100644 (file)
@@ -124,19 +124,23 @@ Drupal.theme.prototype.mkdruFacet = function (terms, facet, max, selections) {
     html += '</a><span> (' + terms[i].freq
         + ')</span><br/>';
   }
-  //TODO, meed to look up target name from ID
   if (terms.length == 0 && selections && selections.length) {
     for (var i=0; i<selections.length; i++) {
       if (selections[i]) {
+        // since we have no target name (only id) go for the basename
+        // FIXME get the proper target name
+        var name = facet == "source" ? selections[i].replace(/.*[\/\\]/, "")
+          .replace(/\?.*/, '')
+          : selections[i];
         html += '<a class="cross" href="'
           + mkdru.removeLimit(facet, selections[i])
-          + '"><strong>'+selections[i]+'</strong></a><span> (0)</span><br/>';
+          + '"><strong>'+name+'</strong></a><span> (0)</span><br/>';
       }
     } 
   }
   return html;
 };
 
-Drupal.theme.prototype.mkdruFacetContainer = function (facetCfg) {
+Drupal.theme.prototype.mkdruFacetContainer = function (facetsCfg) {
   return "";
 };