X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;f=src%2Fmkws-widget-termlists.js;h=fef616f71ae8e6991ce7416ffcbcdfdd0a60267a;hb=56483f51c428061a708d8cdf6eba624db7abeaa5;hp=b16d60c0ff9ebb1fe272b76638577868a477f1d2;hpb=c302068454a4f0a77574eae189b582a01138e763;p=mkws-moved-to-github.git diff --git a/src/mkws-widget-termlists.js b/src/mkws-widget-termlists.js index b16d60c..fef616f 100644 --- a/src/mkws-widget-termlists.js +++ b/src/mkws-widget-termlists.js @@ -39,30 +39,44 @@ 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('