The config value for facet_max_<...> can be a string or a number
authorWolfram Schneider <wosch@indexdata.dk>
Mon, 19 May 2014 12:14:42 +0000 (12:14 +0000)
committerWolfram Schneider <wosch@indexdata.dk>
Mon, 19 May 2014 12:14:42 +0000 (12:14 +0000)
 "facet_max_xtargets" : "10"

our JS code will convert it to a number.

src/mkws-widget-termlists.js

index dc89504..acd9dcf 100644 (file)
@@ -32,7 +32,7 @@ mkws.registerWidgetType('Facet', function() {
   var name = that.config.facet;
   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 max     = parseInt(this.config['facet_max_' + name] || ref[1]);
   var pzIndex = ref[2] ? name : null;
 
   that.toString = function() {