X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;f=src%2Fmkws-widget-termlists.js;h=fef616f71ae8e6991ce7416ffcbcdfdd0a60267a;hb=18e6ebfc3219c0991124d9a3f9968640fb7d95b4;hp=1f13820e4177293d8d551d6ce920390ae197058a;hpb=ed4b067f8083566fa9de056fd7629278228bb2a5;p=mkws-moved-to-github.git diff --git a/src/mkws-widget-termlists.js b/src/mkws-widget-termlists.js index 1f13820..fef616f 100644 --- a/src/mkws-widget-termlists.js +++ b/src/mkws-widget-termlists.js @@ -39,30 +39,40 @@ mkws.registerWidgetType('Facet', function() { return '[Widget ' + that.team.name() + ':' + that.type + '(' + name + ')]'; }; + var t2 = that.team.loadTemplate('Facet-' + caption); + that.log("template for Facet-" + caption + " is " + !!t2); + if (!t2) { + that.log("no " + caption + "-specific template, falling back"); + t2 = that.team.loadTemplate('Facet'); + } + that.log("template for Facet is " + !!t2); + that.team.queue("termlists").subscribe(function(data) { data = data[name]; + var t1 = that.team.loadTemplate('facetTitle-' + caption, mkws.M(caption)) + var title = t1({ query: that.config.query }); + var acc = []; + acc.push('