Simplify generation of facet scaffolding.
authorMike Taylor <mike@indexdata.com>
Mon, 7 Apr 2014 15:55:59 +0000 (16:55 +0100)
committerMike Taylor <mike@indexdata.com>
Mon, 7 Apr 2014 15:55:59 +0000 (16:55 +0100)
No longer needs the use of mkws.facetConfig.

src/mkws-team.js

index 0527c96..70b3558 100644 (file)
@@ -427,6 +427,7 @@ function team($, teamName) {
   </tr>\
 </table>');
 
+       // Can't be local, as the "Facet" widget also needs to consult this.
        mkws.facetConfig = {
            xtargets: [ "Sources",  16, false ],
            subject:  [ "Subjects", 10, true ],
@@ -437,14 +438,8 @@ function team($, teamName) {
        var facets = m_config.facets;
        acc.push('<div class="title">' + M('Termlists') + '</div>');
        for (var i = 0; i < facets.length; i++) {
-           var name = facets[i]
-           var ref = mkws.facetConfig[name];
-           if (!ref) {
-               alert("bad facet configuration: '" + name + "'");
-           } else {
-               acc.push('<div class="mkwsFacet mkwsTeam_' + m_teamName + '" data-mkws-facet="' + name + '">');
-               acc.push('</div>');
-           }
+           acc.push('<div class="mkwsFacet mkwsTeam_' + m_teamName + '" data-mkws-facet="' + facets[i] + '">');
+           acc.push('</div>');
        }
        findnode(".mkwsTermlists").html(acc.join(''));