X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;f=src%2Fmkws-widget-termlists.js;h=1757b62a336e9440da7813e81ac7f47a4d090ad7;hb=9291dd10a58b20838e6e067bd9aefc29a4f827ef;hp=776ef5b009047d092b48efb2578306d66552b73b;hpb=8d43b38a531101963703b6e98681d0de683298ff;p=mkws-moved-to-github.git diff --git a/src/mkws-widget-termlists.js b/src/mkws-widget-termlists.js index 776ef5b..1757b62 100644 --- a/src/mkws-widget-termlists.js +++ b/src/mkws-widget-termlists.js @@ -3,10 +3,10 @@ mkws.registerWidgetType('Termlists', function() { // Initially hide the termlists; display when we get results mkws.$(document).ready(function() { - that.jqnode.hide(); + that.node.hide(); }); this.team.queue("termlists").subscribe(function(data) { - that.jqnode.show(); + that.node.show(); }); var acc = []; @@ -15,9 +15,9 @@ mkws.registerWidgetType('Termlists', function() { for (var i = 0; i < facets.length; i++) { acc.push('
', '
'); } - this.jqnode.html(acc.join('')); + this.node.html(acc.join('')); - widget.autosearch(this); + this.autosearch(); }); @@ -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,8 @@ mkws.registerWidgetType('Facet', function() { acc.push(''); } - that.jqnode.html(acc.join('')); + that.node.html(acc.join('')); }); + + this.autosearch(); });