From: Mike Taylor Date: Fri, 16 May 2014 15:43:12 +0000 (+0100) Subject: Facet captions and maximum counts are now taken from optional X-Git-Tag: 1.0.0~658 X-Git-Url: http://sru.miketaylor.org.uk/cgi-bin?a=commitdiff_plain;h=0d67fad030aca126b43291f6227dc287a6d0d856;p=mkws-moved-to-github.git Facet captions and maximum counts are now taken from optional configuration settings "facet_caption_NAME" and "facet_max_NAME", defaulting to their own hardwired values when these settings are absent. Fixes bug MWKS-192. --- diff --git a/src/mkws-widget-termlists.js b/src/mkws-widget-termlists.js index addfd94..dc89504 100644 --- a/src/mkws-widget-termlists.js +++ b/src/mkws-widget-termlists.js @@ -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 = this.config['facet_max_' + name] || ref[1]; var pzIndex = ref[2] ? name : null; that.toString = function() {