X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;f=src%2Fmkws-widget-termlists.js;h=acd9dcf5d15bb8745a2927a6333f8d2b0093b096;hb=3236c3813f5da23cfb39605574399a6a2d856461;hp=b28261479ea23fbada6fb7cb6410ac84b0c224a4;hpb=f122cb28acf4edfef651bc59472f1a88d03b6035;p=mkws-moved-to-github.git diff --git a/src/mkws-widget-termlists.js b/src/mkws-widget-termlists.js index b282614..acd9dcf 100644 --- a/src/mkws-widget-termlists.js +++ b/src/mkws-widget-termlists.js @@ -2,11 +2,11 @@ mkws.registerWidgetType('Termlists', function() { var that = this; // Initially hide the termlists; display when we get results - $(document).ready(function() { - $(that.node).hide(); + mkws.$(document).ready(function() { + that.node.hide(); }); this.team.queue("termlists").subscribe(function(data) { - $(that.node).show(); + that.node.show(); }); var acc = []; @@ -15,7 +15,7 @@ mkws.registerWidgetType('Termlists', function() { for (var i = 0; i < facets.length; i++) { acc.push('
', '
'); } - $(this.node).html(acc.join('')); + this.node.html(acc.join('')); widget.autosearch(this); }); @@ -30,9 +30,9 @@ mkws.registerWidgetType('Facet', function() { var that = this; var name = that.config.facet; - var ref = facetConfig[name] || alert("no facet definition for '" + name + "'"); - var caption = ref[0]; - var max = ref[1]; + var ref = facetConfig[name] || [ "Unknown", 10, true ]; + var caption = this.config['facet_caption_' + name] || ref[0]; + var max = parseInt(this.config['facet_max_' + name] || ref[1]); var pzIndex = ref[2] ? name : null; that.toString = function() { @@ -63,6 +63,6 @@ mkws.registerWidgetType('Facet', function() { acc.push(''); } - $(that.node).html(acc.join('')); + that.node.html(acc.join('')); }); });