X-Git-Url: http://jsfdemo.indexdata.com/?a=blobdiff_plain;f=src%2Fmkws-widget-termlists.js;h=fef616f71ae8e6991ce7416ffcbcdfdd0a60267a;hb=431016e6786908aef265c74f28c8b3ddc230e2f6;hp=1757b62a336e9440da7813e81ac7f47a4d090ad7;hpb=70370d9efd6fd81f5649958adbea8fd26ab0c7dc;p=mkws-moved-to-github.git diff --git a/src/mkws-widget-termlists.js b/src/mkws-widget-termlists.js index 1757b62..fef616f 100644 --- a/src/mkws-widget-termlists.js +++ b/src/mkws-widget-termlists.js @@ -39,28 +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('